// Copyright 2020 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include "build/build_config.h"
#include "chrome/browser/ui/views/web_apps/web_app_integration_test_driver.h"
#include "components/services/app_service/public/mojom/types.mojom.h"
#include "content/public/test/browser_test.h"

namespace web_app {

// Manual tests:

IN_PROC_BROWSER_TEST_F(WebAppIntegrationBrowserTest, UninstallFromList) {
  helper_.InstallCreateShortcutWindowed("SiteA");
  helper_.UninstallFromList("SiteA");
  helper_.CheckAppNotInList("SiteA");
}

IN_PROC_BROWSER_TEST_F(WebAppIntegrationBrowserTest, ManifestUpdateScope) {
  helper_.InstallOmniboxIcon("SiteAFoo");
  helper_.ClosePwa();
  helper_.ManifestUpdateScopeSiteAFooTo("SiteA");
  helper_.NavigateBrowser("SiteA");
  helper_.CheckLaunchIconShown();
}

IN_PROC_BROWSER_TEST_F(WebAppIntegrationBrowserTest, VerifyWindowModeChanged) {
  helper_.InstallCreateShortcutWindowed("SiteA");
  helper_.CheckAppWindowMode("SiteA", apps::mojom::WindowMode::kWindow);
  // Change to tabbed mode
  helper_.ChangeAppSettingsWindowMode("SiteA",
                                      apps::mojom::WindowMode::kTabbedWindow);
#if BUILDFLAG(IS_CHROMEOS)
  helper_.CheckAppWindowMode("SiteA", apps::mojom::WindowMode::kWindow);
#else
  // Verify change is propagated in W/M/L cases
  helper_.CheckAppWindowMode("SiteA", apps::mojom::WindowMode::kTabbedWindow);
#endif
}

// Automated tests:

// TODO(crbug.com/1279704): Test is consistently failing on Mac and Win7.
IN_PROC_BROWSER_TEST_F(
    WebAppIntegrationBrowserTest,
    DISABLED_WebAppIntegration_InstCrtShctWindowedSiteA_WindowCreated_InListWinSiteA_InstPlcyTabNoShctSiteA_InListWinSiteA_NavSiteA_LaunchIconShown) {
  // Test contents are generated by script. Please do not modify!
  // See `chrome/test/webapps/README.md` for more info.
  // Sheriffs: Disabling this test is supported.
  helper_.InstallCreateShortcutWindowed("SiteA");
  helper_.CheckWindowCreated();
  helper_.CheckAppInListWindowed("SiteA");
  helper_.InstallPolicyAppTabbedNoShortcut("SiteA");
  helper_.CheckAppInListWindowed("SiteA");
  helper_.NavigateBrowser("SiteA");
  helper_.CheckLaunchIconShown();
}

IN_PROC_BROWSER_TEST_F(
    WebAppIntegrationBrowserTest,
    WebAppIntegration_InstCrtShctWindowedSiteA_WindowCreated_InListWinSiteA_InstPlcyTabNoShctSiteA_InListWinSiteA_LaunchFromListSiteA_WindowCreated) {
  // Test contents are generated by script. Please do not modify!
  // See `chrome/test/webapps/README.md` for more info.
  // Sheriffs: Disabling this test is supported.
  helper_.InstallCreateShortcutWindowed("SiteA");
  helper_.CheckWindowCreated();
  helper_.CheckAppInListWindowed("SiteA");
  helper_.InstallPolicyAppTabbedNoShortcut("SiteA");
  helper_.CheckAppInListWindowed("SiteA");
  helper_.LaunchFromChromeApps("SiteA");
  helper_.CheckWindowCreated();
}

IN_PROC_BROWSER_TEST_F(
    WebAppIntegrationBrowserTest,
    WebAppIntegration_InstCrtShctWindowedSiteA_WindowCreated_InListWinSiteA_InstPlcyTabNoShctSiteA_InListWinSiteA_UninstallPlcySiteA_InListWinSiteA) {
  // Test contents are generated by script. Please do not modify!
  // See `chrome/test/webapps/README.md` for more info.
  // Sheriffs: Disabling this test is supported.
  helper_.InstallCreateShortcutWindowed("SiteA");
  helper_.CheckWindowCreated();
  helper_.CheckAppInListWindowed("SiteA");
  helper_.InstallPolicyAppTabbedNoShortcut("SiteA");
  helper_.CheckAppInListWindowed("SiteA");
  helper_.UninstallPolicyApp("SiteA");
  helper_.CheckAppInListWindowed("SiteA");
}

IN_PROC_BROWSER_TEST_F(
    WebAppIntegrationBrowserTest,
    WebAppIntegration_InstCrtShctWindowedSiteA_WindowCreated_InListWinSiteA_InstPlcyWinNoShctSiteA_UninstallPlcySiteA_InListWinSiteA) {
  // Test contents are generated by script. Please do not modify!
  // See `chrome/test/webapps/README.md` for more info.
  // Sheriffs: Disabling this test is supported.
  helper_.InstallCreateShortcutWindowed("SiteA");
  helper_.CheckWindowCreated();
  helper_.CheckAppInListWindowed("SiteA");
  helper_.InstallPolicyAppWindowedNoShortcut("SiteA");
  helper_.UninstallPolicyApp("SiteA");
  helper_.CheckAppInListWindowed("SiteA");
}

IN_PROC_BROWSER_TEST_F(
    WebAppIntegrationBrowserTest,
    WebAppIntegration_InstCrtShctWindowedSiteA_WindowCreated_InListWinSiteA_InstPlcyTabShctSiteA_InListWinSiteA_NavSiteA_LaunchIconShown) {
  // Test contents are generated by script. Please do not modify!
  // See `chrome/test/webapps/README.md` for more info.
  // Sheriffs: Disabling this test is supported.
  helper_.InstallCreateShortcutWindowed("SiteA");
  helper_.CheckWindowCreated();
  helper_.CheckAppInListWindowed("SiteA");
  helper_.InstallPolicyAppTabbedShortcut("SiteA");
  helper_.CheckAppInListWindowed("SiteA");
  helper_.NavigateBrowser("SiteA");
  helper_.CheckLaunchIconShown();
}

IN_PROC_BROWSER_TEST_F(
    WebAppIntegrationBrowserTest,
    WebAppIntegration_InstCrtShctWindowedSiteA_WindowCreated_InListWinSiteA_InstPlcyTabShctSiteA_InListWinSiteA_LaunchFromListSiteA_WindowCreated) {
  // Test contents are generated by script. Please do not modify!
  // See `chrome/test/webapps/README.md` for more info.
  // Sheriffs: Disabling this test is supported.
  helper_.InstallCreateShortcutWindowed("SiteA");
  helper_.CheckWindowCreated();
  helper_.CheckAppInListWindowed("SiteA");
  helper_.InstallPolicyAppTabbedShortcut("SiteA");
  helper_.CheckAppInListWindowed("SiteA");
  helper_.LaunchFromChromeApps("SiteA");
  helper_.CheckWindowCreated();
}

IN_PROC_BROWSER_TEST_F(
    WebAppIntegrationBrowserTest,
    WebAppIntegration_InstCrtShctWindowedSiteA_WindowCreated_InListWinSiteA_InstPlcyTabShctSiteA_InListWinSiteA_UninstallPlcySiteA_InListWinSiteA) {
  // Test contents are generated by script. Please do not modify!
  // See `chrome/test/webapps/README.md` for more info.
  // Sheriffs: Disabling this test is supported.
  helper_.InstallCreateShortcutWindowed("SiteA");
  helper_.CheckWindowCreated();
  helper_.CheckAppInListWindowed("SiteA");
  helper_.InstallPolicyAppTabbedShortcut("SiteA");
  helper_.CheckAppInListWindowed("SiteA");
  helper_.UninstallPolicyApp("SiteA");
  helper_.CheckAppInListWindowed("SiteA");
}

IN_PROC_BROWSER_TEST_F(
    WebAppIntegrationBrowserTest,
    WebAppIntegration_InstCrtShctWindowedSiteA_WindowCreated_InListWinSiteA_NavSiteA_InstIconNotShown_LaunchIconShown) {
  // Test contents are generated by script. Please do not modify!
  // See `chrome/test/webapps/README.md` for more info.
  // Sheriffs: Disabling this test is supported.
  helper_.InstallCreateShortcutWindowed("SiteA");
  helper_.CheckWindowCreated();
  helper_.CheckAppInListWindowed("SiteA");
  helper_.NavigateBrowser("SiteA");
  helper_.CheckInstallIconNotShown();
  helper_.CheckLaunchIconShown();
}

IN_PROC_BROWSER_TEST_F(
    WebAppIntegrationBrowserTest,
    DISABLED_WebAppIntegration_InstCrtShctWindowedSiteA_WindowCreated_InListWinSiteA_ClosePWA_MnfstUpdateDsplMinimalSiteA_LaunchFromListSiteA_Minimal) {
  // Test contents are generated by script. Please do not modify!
  // See `chrome/test/webapps/README.md` for more info.
  // Sheriffs: Disabling this test is supported.
  helper_.InstallCreateShortcutWindowed("SiteA");
  helper_.CheckWindowCreated();
  helper_.CheckAppInListWindowed("SiteA");
  helper_.ClosePwa();
  helper_.ManifestUpdateDisplayMinimal("SiteA");
  helper_.LaunchFromChromeApps("SiteA");
  helper_.CheckWindowDisplayMinimal();
}

IN_PROC_BROWSER_TEST_F(
    WebAppIntegrationBrowserTest,
    WebAppIntegration_InstCrtShctWindowedSiteA_WindowCreated_InListWinSiteA_LaunchFromListSiteA_WindowCreated_Standalone) {
  // Test contents are generated by script. Please do not modify!
  // See `chrome/test/webapps/README.md` for more info.
  // Sheriffs: Disabling this test is supported.
  helper_.InstallCreateShortcutWindowed("SiteA");
  helper_.CheckWindowCreated();
  helper_.CheckAppInListWindowed("SiteA");
  helper_.LaunchFromChromeApps("SiteA");
  helper_.CheckWindowCreated();
  helper_.CheckWindowDisplayStandalone();
}

IN_PROC_BROWSER_TEST_F(
    WebAppIntegrationBrowserTest,
    WebAppIntegration_InstCrtShctWindowedSiteA_WindowCreated_InListWinSiteA_SetOpenTabSiteA_InListTabbedSiteA_LaunchFromListSiteA_TabCreated) {
  // Test contents are generated by script. Please do not modify!
  // See `chrome/test/webapps/README.md` for more info.
  // Sheriffs: Disabling this test is supported.
  helper_.InstallCreateShortcutWindowed("SiteA");
  helper_.CheckWindowCreated();
  helper_.CheckAppInListWindowed("SiteA");
  helper_.SetOpenInTab("SiteA");
  helper_.CheckAppInListTabbed("SiteA");
  helper_.LaunchFromChromeApps("SiteA");
  helper_.CheckTabCreated();
}

IN_PROC_BROWSER_TEST_F(
    WebAppIntegrationBrowserTest,
    WebAppIntegration_InstCrtShctWindowedSiteA_WindowCreated_InListWinSiteA_SetOpenTabSiteA_InListTabbedSiteA_NavSiteA_InstIconShown) {
  // Test contents are generated by script. Please do not modify!
  // See `chrome/test/webapps/README.md` for more info.
  // Sheriffs: Disabling this test is supported.
  helper_.InstallCreateShortcutWindowed("SiteA");
  helper_.CheckWindowCreated();
  helper_.CheckAppInListWindowed("SiteA");
  helper_.SetOpenInTab("SiteA");
  helper_.CheckAppInListTabbed("SiteA");
  helper_.NavigateBrowser("SiteA");
  helper_.CheckInstallIconShown();
}

IN_PROC_BROWSER_TEST_F(
    WebAppIntegrationBrowserTest,
    WebAppIntegration_InstCrtShctWindowedSiteA_WindowCreated_InListWinSiteA_NavSiteAFoo_InstIconNotShown_LaunchIconShown) {
  // Test contents are generated by script. Please do not modify!
  // See `chrome/test/webapps/README.md` for more info.
  // Sheriffs: Disabling this test is supported.
  helper_.InstallCreateShortcutWindowed("SiteA");
  helper_.CheckWindowCreated();
  helper_.CheckAppInListWindowed("SiteA");
  helper_.NavigateBrowser("SiteAFoo");
  helper_.CheckInstallIconNotShown();
  helper_.CheckLaunchIconShown();
}

IN_PROC_BROWSER_TEST_F(
    WebAppIntegrationBrowserTest,
    WebAppIntegration_InstCrtShctWindowedSiteA_WindowCreated_InListWinSiteA_NavSiteB_InstIconShown_LaunchIconNotShown) {
  // Test contents are generated by script. Please do not modify!
  // See `chrome/test/webapps/README.md` for more info.
  // Sheriffs: Disabling this test is supported.
  helper_.InstallCreateShortcutWindowed("SiteA");
  helper_.CheckWindowCreated();
  helper_.CheckAppInListWindowed("SiteA");
  helper_.NavigateBrowser("SiteB");
  helper_.CheckInstallIconShown();
  helper_.CheckLaunchIconNotShown();
}

IN_PROC_BROWSER_TEST_F(
    WebAppIntegrationBrowserTest,
    WebAppIntegration_InstCrtShctWindowedSiteA_WindowCreated_InListWinSiteA_InstPlcyWinShctSiteA_UninstallPlcySiteA_InListWinSiteA) {
  // Test contents are generated by script. Please do not modify!
  // See `chrome/test/webapps/README.md` for more info.
  // Sheriffs: Disabling this test is supported.
  helper_.InstallCreateShortcutWindowed("SiteA");
  helper_.CheckWindowCreated();
  helper_.CheckAppInListWindowed("SiteA");
  helper_.InstallPolicyAppWindowedShortcut("SiteA");
  helper_.UninstallPolicyApp("SiteA");
  helper_.CheckAppInListWindowed("SiteA");
}

IN_PROC_BROWSER_TEST_F(
    WebAppIntegrationBrowserTest,
    WebAppIntegration_InstOmniboxSiteA_WindowCreated_InListWinSiteA_InstPlcyTabNoShctSiteA_InListWinSiteA_NavSiteA_LaunchIconShown) {
  // Test contents are generated by script. Please do not modify!
  // See `chrome/test/webapps/README.md` for more info.
  // Sheriffs: Disabling this test is supported.
  helper_.InstallOmniboxIcon("SiteA");
  helper_.CheckWindowCreated();
  helper_.CheckAppInListWindowed("SiteA");
  helper_.InstallPolicyAppTabbedNoShortcut("SiteA");
  helper_.CheckAppInListWindowed("SiteA");
  helper_.NavigateBrowser("SiteA");
  helper_.CheckLaunchIconShown();
}

// TODO(crbug.com/1279704): Test is consistently failing on Mac and Win7.
IN_PROC_BROWSER_TEST_F(
    WebAppIntegrationBrowserTest,
    DISABLED_WebAppIntegration_InstOmniboxSiteA_WindowCreated_InListWinSiteA_InstPlcyTabNoShctSiteA_InListWinSiteA_LaunchFromListSiteA_WindowCreated) {
  // Test contents are generated by script. Please do not modify!
  // See `chrome/test/webapps/README.md` for more info.
  // Sheriffs: Disabling this test is supported.
  helper_.InstallOmniboxIcon("SiteA");
  helper_.CheckWindowCreated();
  helper_.CheckAppInListWindowed("SiteA");
  helper_.InstallPolicyAppTabbedNoShortcut("SiteA");
  helper_.CheckAppInListWindowed("SiteA");
  helper_.LaunchFromChromeApps("SiteA");
  helper_.CheckWindowCreated();
}

IN_PROC_BROWSER_TEST_F(
    WebAppIntegrationBrowserTest,
    WebAppIntegration_InstOmniboxSiteA_WindowCreated_InListWinSiteA_InstPlcyTabNoShctSiteA_InListWinSiteA_UninstallPlcySiteA_InListWinSiteA) {
  // Test contents are generated by script. Please do not modify!
  // See `chrome/test/webapps/README.md` for more info.
  // Sheriffs: Disabling this test is supported.
  helper_.InstallOmniboxIcon("SiteA");
  helper_.CheckWindowCreated();
  helper_.CheckAppInListWindowed("SiteA");
  helper_.InstallPolicyAppTabbedNoShortcut("SiteA");
  helper_.CheckAppInListWindowed("SiteA");
  helper_.UninstallPolicyApp("SiteA");
  helper_.CheckAppInListWindowed("SiteA");
}

IN_PROC_BROWSER_TEST_F(
    WebAppIntegrationBrowserTest,
    WebAppIntegration_InstOmniboxSiteA_WindowCreated_InListWinSiteA_InstPlcyWinNoShctSiteA_UninstallPlcySiteA_InListWinSiteA) {
  // Test contents are generated by script. Please do not modify!
  // See `chrome/test/webapps/README.md` for more info.
  // Sheriffs: Disabling this test is supported.
  helper_.InstallOmniboxIcon("SiteA");
  helper_.CheckWindowCreated();
  helper_.CheckAppInListWindowed("SiteA");
  helper_.InstallPolicyAppWindowedNoShortcut("SiteA");
  helper_.UninstallPolicyApp("SiteA");
  helper_.CheckAppInListWindowed("SiteA");
}

IN_PROC_BROWSER_TEST_F(
    WebAppIntegrationBrowserTest,
    WebAppIntegration_InstOmniboxSiteA_WindowCreated_InListWinSiteA_InstPlcyTabShctSiteA_InListWinSiteA_NavSiteA_LaunchIconShown) {
  // Test contents are generated by script. Please do not modify!
  // See `chrome/test/webapps/README.md` for more info.
  // Sheriffs: Disabling this test is supported.
  helper_.InstallOmniboxIcon("SiteA");
  helper_.CheckWindowCreated();
  helper_.CheckAppInListWindowed("SiteA");
  helper_.InstallPolicyAppTabbedShortcut("SiteA");
  helper_.CheckAppInListWindowed("SiteA");
  helper_.NavigateBrowser("SiteA");
  helper_.CheckLaunchIconShown();
}

IN_PROC_BROWSER_TEST_F(
    WebAppIntegrationBrowserTest,
    WebAppIntegration_InstOmniboxSiteA_WindowCreated_InListWinSiteA_InstPlcyTabShctSiteA_InListWinSiteA_LaunchFromListSiteA_WindowCreated) {
  // Test contents are generated by script. Please do not modify!
  // See `chrome/test/webapps/README.md` for more info.
  // Sheriffs: Disabling this test is supported.
  helper_.InstallOmniboxIcon("SiteA");
  helper_.CheckWindowCreated();
  helper_.CheckAppInListWindowed("SiteA");
  helper_.InstallPolicyAppTabbedShortcut("SiteA");
  helper_.CheckAppInListWindowed("SiteA");
  helper_.LaunchFromChromeApps("SiteA");
  helper_.CheckWindowCreated();
}

IN_PROC_BROWSER_TEST_F(
    WebAppIntegrationBrowserTest,
    WebAppIntegration_InstOmniboxSiteA_WindowCreated_InListWinSiteA_InstPlcyTabShctSiteA_InListWinSiteA_UninstallPlcySiteA_InListWinSiteA) {
  // Test contents are generated by script. Please do not modify!
  // See `chrome/test/webapps/README.md` for more info.
  // Sheriffs: Disabling this test is supported.
  helper_.InstallOmniboxIcon("SiteA");
  helper_.CheckWindowCreated();
  helper_.CheckAppInListWindowed("SiteA");
  helper_.InstallPolicyAppTabbedShortcut("SiteA");
  helper_.CheckAppInListWindowed("SiteA");
  helper_.UninstallPolicyApp("SiteA");
  helper_.CheckAppInListWindowed("SiteA");
}

// TODO(crbug.com/1279704): Flaky on macOS.
#if BUILDFLAG(IS_MAC)
#define MAYBE_WebAppIntegration_InstOmniboxSiteA_WindowCreated_InListWinSiteA_NavSiteA_InstIconNotShown_LaunchIconShown \
  DISABLED_WebAppIntegration_InstOmniboxSiteA_WindowCreated_InListWinSiteA_NavSiteA_InstIconNotShown_LaunchIconShown
#else
#define MAYBE_WebAppIntegration_InstOmniboxSiteA_WindowCreated_InListWinSiteA_NavSiteA_InstIconNotShown_LaunchIconShown \
  WebAppIntegration_InstOmniboxSiteA_WindowCreated_InListWinSiteA_NavSiteA_InstIconNotShown_LaunchIconShown
#endif
IN_PROC_BROWSER_TEST_F(
    WebAppIntegrationBrowserTest,
    MAYBE_WebAppIntegration_InstOmniboxSiteA_WindowCreated_InListWinSiteA_NavSiteA_InstIconNotShown_LaunchIconShown) {
  // Test contents are generated by script. Please do not modify!
  // See `chrome/test/webapps/README.md` for more info.
  // Sheriffs: Disabling this test is supported.
  helper_.InstallOmniboxIcon("SiteA");
  helper_.CheckWindowCreated();
  helper_.CheckAppInListWindowed("SiteA");
  helper_.NavigateBrowser("SiteA");
  helper_.CheckInstallIconNotShown();
  helper_.CheckLaunchIconShown();
}

IN_PROC_BROWSER_TEST_F(
    WebAppIntegrationBrowserTest,
    DISABLED_WebAppIntegration_InstOmniboxSiteA_WindowCreated_InListWinSiteA_ClosePWA_MnfstUpdateDsplMinimalSiteA_LaunchFromListSiteA_Minimal) {
  // Test contents are generated by script. Please do not modify!
  // See `chrome/test/webapps/README.md` for more info.
  // Sheriffs: Disabling this test is supported.
  helper_.InstallOmniboxIcon("SiteA");
  helper_.CheckWindowCreated();
  helper_.CheckAppInListWindowed("SiteA");
  helper_.ClosePwa();
  helper_.ManifestUpdateDisplayMinimal("SiteA");
  helper_.LaunchFromChromeApps("SiteA");
  helper_.CheckWindowDisplayMinimal();
}

IN_PROC_BROWSER_TEST_F(
    WebAppIntegrationBrowserTest,
    WebAppIntegration_InstOmniboxSiteA_WindowCreated_InListWinSiteA_LaunchFromListSiteA_WindowCreated_Standalone) {
  // Test contents are generated by script. Please do not modify!
  // See `chrome/test/webapps/README.md` for more info.
  // Sheriffs: Disabling this test is supported.
  helper_.InstallOmniboxIcon("SiteA");
  helper_.CheckWindowCreated();
  helper_.CheckAppInListWindowed("SiteA");
  helper_.LaunchFromChromeApps("SiteA");
  helper_.CheckWindowCreated();
  helper_.CheckWindowDisplayStandalone();
}

IN_PROC_BROWSER_TEST_F(
    WebAppIntegrationBrowserTest,
    WebAppIntegration_InstOmniboxSiteA_WindowCreated_InListWinSiteA_SetOpenTabSiteA_InListTabbedSiteA_LaunchFromListSiteA_TabCreated) {
  // Test contents are generated by script. Please do not modify!
  // See `chrome/test/webapps/README.md` for more info.
  // Sheriffs: Disabling this test is supported.
  helper_.InstallOmniboxIcon("SiteA");
  helper_.CheckWindowCreated();
  helper_.CheckAppInListWindowed("SiteA");
  helper_.SetOpenInTab("SiteA");
  helper_.CheckAppInListTabbed("SiteA");
  helper_.LaunchFromChromeApps("SiteA");
  helper_.CheckTabCreated();
}

IN_PROC_BROWSER_TEST_F(
    WebAppIntegrationBrowserTest,
    WebAppIntegration_InstOmniboxSiteA_WindowCreated_InListWinSiteA_SetOpenTabSiteA_InListTabbedSiteA_NavSiteA_InstIconShown) {
  // Test contents are generated by script. Please do not modify!
  // See `chrome/test/webapps/README.md` for more info.
  // Sheriffs: Disabling this test is supported.
  helper_.InstallOmniboxIcon("SiteA");
  helper_.CheckWindowCreated();
  helper_.CheckAppInListWindowed("SiteA");
  helper_.SetOpenInTab("SiteA");
  helper_.CheckAppInListTabbed("SiteA");
  helper_.NavigateBrowser("SiteA");
  helper_.CheckInstallIconShown();
}

IN_PROC_BROWSER_TEST_F(
    WebAppIntegrationBrowserTest,
    WebAppIntegration_InstOmniboxSiteA_WindowCreated_InListWinSiteA_NavSiteAFoo_InstIconNotShown_LaunchIconShown) {
  // Test contents are generated by script. Please do not modify!
  // See `chrome/test/webapps/README.md` for more info.
  // Sheriffs: Disabling this test is supported.
  helper_.InstallOmniboxIcon("SiteA");
  helper_.CheckWindowCreated();
  helper_.CheckAppInListWindowed("SiteA");
  helper_.NavigateBrowser("SiteAFoo");
  helper_.CheckInstallIconNotShown();
  helper_.CheckLaunchIconShown();
}

IN_PROC_BROWSER_TEST_F(
    WebAppIntegrationBrowserTest,
    WebAppIntegration_InstOmniboxSiteA_WindowCreated_InListWinSiteA_NavSiteB_InstIconShown_LaunchIconNotShown) {
  // Test contents are generated by script. Please do not modify!
  // See `chrome/test/webapps/README.md` for more info.
  // Sheriffs: Disabling this test is supported.
  helper_.InstallOmniboxIcon("SiteA");
  helper_.CheckWindowCreated();
  helper_.CheckAppInListWindowed("SiteA");
  helper_.NavigateBrowser("SiteB");
  helper_.CheckInstallIconShown();
  helper_.CheckLaunchIconNotShown();
}

IN_PROC_BROWSER_TEST_F(
    WebAppIntegrationBrowserTest,
    WebAppIntegration_InstOmniboxSiteA_WindowCreated_InListWinSiteA_InstPlcyWinShctSiteA_UninstallPlcySiteA_InListWinSiteA) {
  // Test contents are generated by script. Please do not modify!
  // See `chrome/test/webapps/README.md` for more info.
  // Sheriffs: Disabling this test is supported.
  helper_.InstallOmniboxIcon("SiteA");
  helper_.CheckWindowCreated();
  helper_.CheckAppInListWindowed("SiteA");
  helper_.InstallPolicyAppWindowedShortcut("SiteA");
  helper_.UninstallPolicyApp("SiteA");
  helper_.CheckAppInListWindowed("SiteA");
}

IN_PROC_BROWSER_TEST_F(
    WebAppIntegrationBrowserTest,
    WebAppIntegration_InstMenuOptionSiteA_WindowCreated_InListWinSiteA_InstPlcyTabNoShctSiteA_InListWinSiteA_NavSiteA_LaunchIconShown) {
  // Test contents are generated by script. Please do not modify!
  // See `chrome/test/webapps/README.md` for more info.
  // Sheriffs: Disabling this test is supported.
  helper_.InstallMenuOption("SiteA");
  helper_.CheckWindowCreated();
  helper_.CheckAppInListWindowed("SiteA");
  helper_.InstallPolicyAppTabbedNoShortcut("SiteA");
  helper_.CheckAppInListWindowed("SiteA");
  helper_.NavigateBrowser("SiteA");
  helper_.CheckLaunchIconShown();
}

IN_PROC_BROWSER_TEST_F(
    WebAppIntegrationBrowserTest,
    WebAppIntegration_InstMenuOptionSiteA_WindowCreated_InListWinSiteA_InstPlcyTabNoShctSiteA_InListWinSiteA_LaunchFromListSiteA_WindowCreated) {
  // Test contents are generated by script. Please do not modify!
  // See `chrome/test/webapps/README.md` for more info.
  // Sheriffs: Disabling this test is supported.
  helper_.InstallMenuOption("SiteA");
  helper_.CheckWindowCreated();
  helper_.CheckAppInListWindowed("SiteA");
  helper_.InstallPolicyAppTabbedNoShortcut("SiteA");
  helper_.CheckAppInListWindowed("SiteA");
  helper_.LaunchFromChromeApps("SiteA");
  helper_.CheckWindowCreated();
}

IN_PROC_BROWSER_TEST_F(
    WebAppIntegrationBrowserTest,
    WebAppIntegration_InstMenuOptionSiteA_WindowCreated_InListWinSiteA_InstPlcyTabNoShctSiteA_InListWinSiteA_UninstallPlcySiteA_InListWinSiteA) {
  // Test contents are generated by script. Please do not modify!
  // See `chrome/test/webapps/README.md` for more info.
  // Sheriffs: Disabling this test is supported.
  helper_.InstallMenuOption("SiteA");
  helper_.CheckWindowCreated();
  helper_.CheckAppInListWindowed("SiteA");
  helper_.InstallPolicyAppTabbedNoShortcut("SiteA");
  helper_.CheckAppInListWindowed("SiteA");
  helper_.UninstallPolicyApp("SiteA");
  helper_.CheckAppInListWindowed("SiteA");
}

IN_PROC_BROWSER_TEST_F(
    WebAppIntegrationBrowserTest,
    WebAppIntegration_InstMenuOptionSiteA_WindowCreated_InListWinSiteA_InstPlcyWinNoShctSiteA_UninstallPlcySiteA_InListWinSiteA) {
  // Test contents are generated by script. Please do not modify!
  // See `chrome/test/webapps/README.md` for more info.
  // Sheriffs: Disabling this test is supported.
  helper_.InstallMenuOption("SiteA");
  helper_.CheckWindowCreated();
  helper_.CheckAppInListWindowed("SiteA");
  helper_.InstallPolicyAppWindowedNoShortcut("SiteA");
  helper_.UninstallPolicyApp("SiteA");
  helper_.CheckAppInListWindowed("SiteA");
}

IN_PROC_BROWSER_TEST_F(
    WebAppIntegrationBrowserTest,
    WebAppIntegration_InstMenuOptionSiteA_WindowCreated_InListWinSiteA_InstPlcyTabShctSiteA_InListWinSiteA_NavSiteA_LaunchIconShown) {
  // Test contents are generated by script. Please do not modify!
  // See `chrome/test/webapps/README.md` for more info.
  // Sheriffs: Disabling this test is supported.
  helper_.InstallMenuOption("SiteA");
  helper_.CheckWindowCreated();
  helper_.CheckAppInListWindowed("SiteA");
  helper_.InstallPolicyAppTabbedShortcut("SiteA");
  helper_.CheckAppInListWindowed("SiteA");
  helper_.NavigateBrowser("SiteA");
  helper_.CheckLaunchIconShown();
}

IN_PROC_BROWSER_TEST_F(
    WebAppIntegrationBrowserTest,
    WebAppIntegration_InstMenuOptionSiteA_WindowCreated_InListWinSiteA_InstPlcyTabShctSiteA_InListWinSiteA_LaunchFromListSiteA_WindowCreated) {
  // Test contents are generated by script. Please do not modify!
  // See `chrome/test/webapps/README.md` for more info.
  // Sheriffs: Disabling this test is supported.
  helper_.InstallMenuOption("SiteA");
  helper_.CheckWindowCreated();
  helper_.CheckAppInListWindowed("SiteA");
  helper_.InstallPolicyAppTabbedShortcut("SiteA");
  helper_.CheckAppInListWindowed("SiteA");
  helper_.LaunchFromChromeApps("SiteA");
  helper_.CheckWindowCreated();
}

IN_PROC_BROWSER_TEST_F(
    WebAppIntegrationBrowserTest,
    WebAppIntegration_InstMenuOptionSiteA_WindowCreated_InListWinSiteA_InstPlcyTabShctSiteA_InListWinSiteA_UninstallPlcySiteA_InListWinSiteA) {
  // Test contents are generated by script. Please do not modify!
  // See `chrome/test/webapps/README.md` for more info.
  // Sheriffs: Disabling this test is supported.
  helper_.InstallMenuOption("SiteA");
  helper_.CheckWindowCreated();
  helper_.CheckAppInListWindowed("SiteA");
  helper_.InstallPolicyAppTabbedShortcut("SiteA");
  helper_.CheckAppInListWindowed("SiteA");
  helper_.UninstallPolicyApp("SiteA");
  helper_.CheckAppInListWindowed("SiteA");
}

IN_PROC_BROWSER_TEST_F(
    WebAppIntegrationBrowserTest,
    WebAppIntegration_InstMenuOptionSiteA_WindowCreated_InListWinSiteA_NavSiteA_InstIconNotShown_LaunchIconShown) {
  // Test contents are generated by script. Please do not modify!
  // See `chrome/test/webapps/README.md` for more info.
  // Sheriffs: Disabling this test is supported.
  helper_.InstallMenuOption("SiteA");
  helper_.CheckWindowCreated();
  helper_.CheckAppInListWindowed("SiteA");
  helper_.NavigateBrowser("SiteA");
  helper_.CheckInstallIconNotShown();
  helper_.CheckLaunchIconShown();
}

IN_PROC_BROWSER_TEST_F(
    WebAppIntegrationBrowserTest,
    DISABLED_WebAppIntegration_InstMenuOptionSiteA_WindowCreated_InListWinSiteA_ClosePWA_MnfstUpdateDsplMinimalSiteA_LaunchFromListSiteA_Minimal) {
  // Test contents are generated by script. Please do not modify!
  // See `chrome/test/webapps/README.md` for more info.
  // Sheriffs: Disabling this test is supported.
  helper_.InstallMenuOption("SiteA");
  helper_.CheckWindowCreated();
  helper_.CheckAppInListWindowed("SiteA");
  helper_.ClosePwa();
  helper_.ManifestUpdateDisplayMinimal("SiteA");
  helper_.LaunchFromChromeApps("SiteA");
  helper_.CheckWindowDisplayMinimal();
}

IN_PROC_BROWSER_TEST_F(
    WebAppIntegrationBrowserTest,
    WebAppIntegration_InstMenuOptionSiteA_WindowCreated_InListWinSiteA_LaunchFromListSiteA_WindowCreated_Standalone) {
  // Test contents are generated by script. Please do not modify!
  // See `chrome/test/webapps/README.md` for more info.
  // Sheriffs: Disabling this test is supported.
  helper_.InstallMenuOption("SiteA");
  helper_.CheckWindowCreated();
  helper_.CheckAppInListWindowed("SiteA");
  helper_.LaunchFromChromeApps("SiteA");
  helper_.CheckWindowCreated();
  helper_.CheckWindowDisplayStandalone();
}

IN_PROC_BROWSER_TEST_F(
    WebAppIntegrationBrowserTest,
    WebAppIntegration_InstMenuOptionSiteA_WindowCreated_InListWinSiteA_SetOpenTabSiteA_InListTabbedSiteA_LaunchFromListSiteA_TabCreated) {
  // Test contents are generated by script. Please do not modify!
  // See `chrome/test/webapps/README.md` for more info.
  // Sheriffs: Disabling this test is supported.
  helper_.InstallMenuOption("SiteA");
  helper_.CheckWindowCreated();
  helper_.CheckAppInListWindowed("SiteA");
  helper_.SetOpenInTab("SiteA");
  helper_.CheckAppInListTabbed("SiteA");
  helper_.LaunchFromChromeApps("SiteA");
  helper_.CheckTabCreated();
}

// TODO(crbug.com/1279704): Test is consistently failing on Mac and Win7.
IN_PROC_BROWSER_TEST_F(
    WebAppIntegrationBrowserTest,
    DISABLED_WebAppIntegration_InstMenuOptionSiteA_WindowCreated_InListWinSiteA_SetOpenTabSiteA_InListTabbedSiteA_NavSiteA_InstIconShown) {
  // Test contents are generated by script. Please do not modify!
  // See `chrome/test/webapps/README.md` for more info.
  // Sheriffs: Disabling this test is supported.
  helper_.InstallMenuOption("SiteA");
  helper_.CheckWindowCreated();
  helper_.CheckAppInListWindowed("SiteA");
  helper_.SetOpenInTab("SiteA");
  helper_.CheckAppInListTabbed("SiteA");
  helper_.NavigateBrowser("SiteA");
  helper_.CheckInstallIconShown();
}

// TODO(crbug.com/1279704): Test is consistently failing on Mac and Win7.
IN_PROC_BROWSER_TEST_F(
    WebAppIntegrationBrowserTest,
    DISABLED_WebAppIntegration_InstMenuOptionSiteA_WindowCreated_InListWinSiteA_NavSiteAFoo_InstIconNotShown_LaunchIconShown) {
  // Test contents are generated by script. Please do not modify!
  // See `chrome/test/webapps/README.md` for more info.
  // Sheriffs: Disabling this test is supported.
  helper_.InstallMenuOption("SiteA");
  helper_.CheckWindowCreated();
  helper_.CheckAppInListWindowed("SiteA");
  helper_.NavigateBrowser("SiteAFoo");
  helper_.CheckInstallIconNotShown();
  helper_.CheckLaunchIconShown();
}

IN_PROC_BROWSER_TEST_F(
    WebAppIntegrationBrowserTest,
    WebAppIntegration_InstMenuOptionSiteA_WindowCreated_InListWinSiteA_NavSiteB_InstIconShown_LaunchIconNotShown) {
  // Test contents are generated by script. Please do not modify!
  // See `chrome/test/webapps/README.md` for more info.
  // Sheriffs: Disabling this test is supported.
  helper_.InstallMenuOption("SiteA");
  helper_.CheckWindowCreated();
  helper_.CheckAppInListWindowed("SiteA");
  helper_.NavigateBrowser("SiteB");
  helper_.CheckInstallIconShown();
  helper_.CheckLaunchIconNotShown();
}

IN_PROC_BROWSER_TEST_F(
    WebAppIntegrationBrowserTest,
    WebAppIntegration_InstMenuOptionSiteA_WindowCreated_InListWinSiteA_InstPlcyWinShctSiteA_UninstallPlcySiteA_InListWinSiteA) {
  // Test contents are generated by script. Please do not modify!
  // See `chrome/test/webapps/README.md` for more info.
  // Sheriffs: Disabling this test is supported.
  helper_.InstallMenuOption("SiteA");
  helper_.CheckWindowCreated();
  helper_.CheckAppInListWindowed("SiteA");
  helper_.InstallPolicyAppWindowedShortcut("SiteA");
  helper_.UninstallPolicyApp("SiteA");
  helper_.CheckAppInListWindowed("SiteA");
}

IN_PROC_BROWSER_TEST_F(
    WebAppIntegrationBrowserTest,
    WebAppIntegration_InstPlcyWinNoShctSiteA_InListWinSiteA_NavSiteA_InstIconNotShown_LaunchIconShown) {
  // Test contents are generated by script. Please do not modify!
  // See `chrome/test/webapps/README.md` for more info.
  // Sheriffs: Disabling this test is supported.
  helper_.InstallPolicyAppWindowedNoShortcut("SiteA");
  helper_.CheckAppInListWindowed("SiteA");
  helper_.NavigateBrowser("SiteA");
  helper_.CheckInstallIconNotShown();
  helper_.CheckLaunchIconShown();
}

// TODO(crbug.com/1279704): Flaky on macOS.
#if BUILDFLAG(IS_MAC)
#define MAYBE_WebAppIntegration_InstPlcyWinNoShctSiteA_InListWinSiteA_LaunchFromListSiteA_WindowCreated_Standalone \
  DISABLED_WebAppIntegration_InstPlcyWinNoShctSiteA_InListWinSiteA_LaunchFromListSiteA_WindowCreated_Standalone
#else
#define MAYBE_WebAppIntegration_InstPlcyWinNoShctSiteA_InListWinSiteA_LaunchFromListSiteA_WindowCreated_Standalone \
  WebAppIntegration_InstPlcyWinNoShctSiteA_InListWinSiteA_LaunchFromListSiteA_WindowCreated_Standalone
#endif
IN_PROC_BROWSER_TEST_F(
    WebAppIntegrationBrowserTest,
    MAYBE_WebAppIntegration_InstPlcyWinNoShctSiteA_InListWinSiteA_LaunchFromListSiteA_WindowCreated_Standalone) {
  // Test contents are generated by script. Please do not modify!
  // See `chrome/test/webapps/README.md` for more info.
  // Sheriffs: Disabling this test is supported.
  helper_.InstallPolicyAppWindowedNoShortcut("SiteA");
  helper_.CheckAppInListWindowed("SiteA");
  helper_.LaunchFromChromeApps("SiteA");
  helper_.CheckWindowCreated();
  helper_.CheckWindowDisplayStandalone();
}

IN_PROC_BROWSER_TEST_F(
    WebAppIntegrationBrowserTest,
    WebAppIntegration_InstPlcyWinNoShctSiteA_InListWinSiteA_SetOpenTabSiteA_LaunchFromListSiteA_TabCreated) {
  // Test contents are generated by script. Please do not modify!
  // See `chrome/test/webapps/README.md` for more info.
  // Sheriffs: Disabling this test is supported.
  helper_.InstallPolicyAppWindowedNoShortcut("SiteA");
  helper_.CheckAppInListWindowed("SiteA");
  helper_.SetOpenInTab("SiteA");
  helper_.LaunchFromChromeApps("SiteA");
  helper_.CheckTabCreated();
}

IN_PROC_BROWSER_TEST_F(
    WebAppIntegrationBrowserTest,
    WebAppIntegration_InstPlcyWinNoShctSiteA_InListWinSiteA_NavSiteAFoo_InstIconNotShown_LaunchIconShown) {
  // Test contents are generated by script. Please do not modify!
  // See `chrome/test/webapps/README.md` for more info.
  // Sheriffs: Disabling this test is supported.
  helper_.InstallPolicyAppWindowedNoShortcut("SiteA");
  helper_.CheckAppInListWindowed("SiteA");
  helper_.NavigateBrowser("SiteAFoo");
  helper_.CheckInstallIconNotShown();
  helper_.CheckLaunchIconShown();
}

IN_PROC_BROWSER_TEST_F(
    WebAppIntegrationBrowserTest,
    WebAppIntegration_InstPlcyWinNoShctSiteA_InListWinSiteA_UninstallPlcySiteA_NotInListSiteA) {
  // Test contents are generated by script. Please do not modify!
  // See `chrome/test/webapps/README.md` for more info.
  // Sheriffs: Disabling this test is supported.
  helper_.InstallPolicyAppWindowedNoShortcut("SiteA");
  helper_.CheckAppInListWindowed("SiteA");
  helper_.UninstallPolicyApp("SiteA");
  helper_.CheckAppNotInList("SiteA");
}

IN_PROC_BROWSER_TEST_F(
    WebAppIntegrationBrowserTest,
    WebAppIntegration_InstPlcyWinShctSiteA_InListWinSiteA_NavSiteA_InstIconNotShown_LaunchIconShown) {
  // Test contents are generated by script. Please do not modify!
  // See `chrome/test/webapps/README.md` for more info.
  // Sheriffs: Disabling this test is supported.
  helper_.InstallPolicyAppWindowedShortcut("SiteA");
  helper_.CheckAppInListWindowed("SiteA");
  helper_.NavigateBrowser("SiteA");
  helper_.CheckInstallIconNotShown();
  helper_.CheckLaunchIconShown();
}

IN_PROC_BROWSER_TEST_F(
    WebAppIntegrationBrowserTest,
    WebAppIntegration_InstPlcyWinShctSiteA_InListWinSiteA_LaunchFromListSiteA_WindowCreated_Standalone) {
  // Test contents are generated by script. Please do not modify!
  // See `chrome/test/webapps/README.md` for more info.
  // Sheriffs: Disabling this test is supported.
  helper_.InstallPolicyAppWindowedShortcut("SiteA");
  helper_.CheckAppInListWindowed("SiteA");
  helper_.LaunchFromChromeApps("SiteA");
  helper_.CheckWindowCreated();
  helper_.CheckWindowDisplayStandalone();
}

IN_PROC_BROWSER_TEST_F(
    WebAppIntegrationBrowserTest,
    WebAppIntegration_InstPlcyWinShctSiteA_InListWinSiteA_SetOpenTabSiteA_LaunchFromListSiteA_TabCreated) {
  // Test contents are generated by script. Please do not modify!
  // See `chrome/test/webapps/README.md` for more info.
  // Sheriffs: Disabling this test is supported.
  helper_.InstallPolicyAppWindowedShortcut("SiteA");
  helper_.CheckAppInListWindowed("SiteA");
  helper_.SetOpenInTab("SiteA");
  helper_.LaunchFromChromeApps("SiteA");
  helper_.CheckTabCreated();
}

IN_PROC_BROWSER_TEST_F(
    WebAppIntegrationBrowserTest,
    WebAppIntegration_InstPlcyWinShctSiteA_InListWinSiteA_NavSiteAFoo_InstIconNotShown_LaunchIconShown) {
  // Test contents are generated by script. Please do not modify!
  // See `chrome/test/webapps/README.md` for more info.
  // Sheriffs: Disabling this test is supported.
  helper_.InstallPolicyAppWindowedShortcut("SiteA");
  helper_.CheckAppInListWindowed("SiteA");
  helper_.NavigateBrowser("SiteAFoo");
  helper_.CheckInstallIconNotShown();
  helper_.CheckLaunchIconShown();
}

IN_PROC_BROWSER_TEST_F(
    WebAppIntegrationBrowserTest,
    WebAppIntegration_InstPlcyWinShctSiteA_InListWinSiteA_UninstallPlcySiteA_NotInListSiteA) {
  // Test contents are generated by script. Please do not modify!
  // See `chrome/test/webapps/README.md` for more info.
  // Sheriffs: Disabling this test is supported.
  helper_.InstallPolicyAppWindowedShortcut("SiteA");
  helper_.CheckAppInListWindowed("SiteA");
  helper_.UninstallPolicyApp("SiteA");
  helper_.CheckAppNotInList("SiteA");
}

// TODO(crbug.com/1279704): Flaky on macOS.
#if BUILDFLAG(IS_MAC)
#define MAYBE_WebAppIntegration_InstPlcyTabNoShctSiteA_InListTabbedSiteA_InstCrtShctWindowedSiteA_InListWinSiteA_WindowCreated_UninstallPlcySiteA_InListWinSiteA \
  DISABLED_WebAppIntegration_InstPlcyTabNoShctSiteA_InListTabbedSiteA_InstCrtShctWindowedSiteA_InListWinSiteA_WindowCreated_UninstallPlcySiteA_InListWinSiteA
#else
#define MAYBE_WebAppIntegration_InstPlcyTabNoShctSiteA_InListTabbedSiteA_InstCrtShctWindowedSiteA_InListWinSiteA_WindowCreated_UninstallPlcySiteA_InListWinSiteA \
  WebAppIntegration_InstPlcyTabNoShctSiteA_InListTabbedSiteA_InstCrtShctWindowedSiteA_InListWinSiteA_WindowCreated_UninstallPlcySiteA_InListWinSiteA
#endif
IN_PROC_BROWSER_TEST_F(
    WebAppIntegrationBrowserTest,
    MAYBE_WebAppIntegration_InstPlcyTabNoShctSiteA_InListTabbedSiteA_InstCrtShctWindowedSiteA_InListWinSiteA_WindowCreated_UninstallPlcySiteA_InListWinSiteA) {
  // Test contents are generated by script. Please do not modify!
  // See `chrome/test/webapps/README.md` for more info.
  // Sheriffs: Disabling this test is supported.
  helper_.InstallPolicyAppTabbedNoShortcut("SiteA");
  helper_.CheckAppInListTabbed("SiteA");
  helper_.InstallCreateShortcutWindowed("SiteA");
  helper_.CheckAppInListWindowed("SiteA");
  helper_.CheckWindowCreated();
  helper_.UninstallPolicyApp("SiteA");
  helper_.CheckAppInListWindowed("SiteA");
}

IN_PROC_BROWSER_TEST_F(
    WebAppIntegrationBrowserTest,
    WebAppIntegration_InstPlcyTabNoShctSiteA_InListTabbedSiteA_InstOmniboxSiteA_InListWinSiteA_WindowCreated_UninstallPlcySiteA_InListWinSiteA) {
  // Test contents are generated by script. Please do not modify!
  // See `chrome/test/webapps/README.md` for more info.
  // Sheriffs: Disabling this test is supported.
  helper_.InstallPolicyAppTabbedNoShortcut("SiteA");
  helper_.CheckAppInListTabbed("SiteA");
  helper_.InstallOmniboxIcon("SiteA");
  helper_.CheckAppInListWindowed("SiteA");
  helper_.CheckWindowCreated();
  helper_.UninstallPolicyApp("SiteA");
  helper_.CheckAppInListWindowed("SiteA");
}

IN_PROC_BROWSER_TEST_F(
    WebAppIntegrationBrowserTest,
    WebAppIntegration_InstPlcyTabNoShctSiteA_InListTabbedSiteA_InstMenuOptionSiteA_InListWinSiteA_WindowCreated_UninstallPlcySiteA_InListWinSiteA) {
  // Test contents are generated by script. Please do not modify!
  // See `chrome/test/webapps/README.md` for more info.
  // Sheriffs: Disabling this test is supported.
  helper_.InstallPolicyAppTabbedNoShortcut("SiteA");
  helper_.CheckAppInListTabbed("SiteA");
  helper_.InstallMenuOption("SiteA");
  helper_.CheckAppInListWindowed("SiteA");
  helper_.CheckWindowCreated();
  helper_.UninstallPolicyApp("SiteA");
  helper_.CheckAppInListWindowed("SiteA");
}

IN_PROC_BROWSER_TEST_F(
    WebAppIntegrationBrowserTest,
    WebAppIntegration_InstPlcyTabNoShctSiteA_InListTabbedSiteA_NavSiteA_InstIconShown_LaunchIconNotShown) {
  // Test contents are generated by script. Please do not modify!
  // See `chrome/test/webapps/README.md` for more info.
  // Sheriffs: Disabling this test is supported.
  helper_.InstallPolicyAppTabbedNoShortcut("SiteA");
  helper_.CheckAppInListTabbed("SiteA");
  helper_.NavigateBrowser("SiteA");
  helper_.CheckInstallIconShown();
  helper_.CheckLaunchIconNotShown();
}

IN_PROC_BROWSER_TEST_F(
    WebAppIntegrationBrowserTest,
    WebAppIntegration_InstPlcyTabNoShctSiteA_InListTabbedSiteA_SetOpenWindowSiteA_LaunchFromListSiteA_WindowCreated) {
  // Test contents are generated by script. Please do not modify!
  // See `chrome/test/webapps/README.md` for more info.
  // Sheriffs: Disabling this test is supported.
  helper_.InstallPolicyAppTabbedNoShortcut("SiteA");
  helper_.CheckAppInListTabbed("SiteA");
  helper_.SetOpenInWindow("SiteA");
  helper_.LaunchFromChromeApps("SiteA");
  helper_.CheckWindowCreated();
}

IN_PROC_BROWSER_TEST_F(
    WebAppIntegrationBrowserTest,
    WebAppIntegration_InstPlcyTabNoShctSiteA_InListTabbedSiteA_UninstallPlcySiteA_NotInListSiteA) {
  // Test contents are generated by script. Please do not modify!
  // See `chrome/test/webapps/README.md` for more info.
  // Sheriffs: Disabling this test is supported.
  helper_.InstallPolicyAppTabbedNoShortcut("SiteA");
  helper_.CheckAppInListTabbed("SiteA");
  helper_.UninstallPolicyApp("SiteA");
  helper_.CheckAppNotInList("SiteA");
}

IN_PROC_BROWSER_TEST_F(
    WebAppIntegrationBrowserTest,
    WebAppIntegration_InstCrtShctTabbedSiteA_InListTabbedSiteA_InstPlcyWinNoShctSiteA_InListTabbedSiteA_NavSiteA_InstIconShown) {
  // Test contents are generated by script. Please do not modify!
  // See `chrome/test/webapps/README.md` for more info.
  // Sheriffs: Disabling this test is supported.
  helper_.InstallCreateShortcutTabbed("SiteA");
  helper_.CheckAppInListTabbed("SiteA");
  helper_.InstallPolicyAppWindowedNoShortcut("SiteA");
  helper_.CheckAppInListTabbed("SiteA");
  helper_.NavigateBrowser("SiteA");
  helper_.CheckInstallIconShown();
}

IN_PROC_BROWSER_TEST_F(
    WebAppIntegrationBrowserTest,
    WebAppIntegration_InstCrtShctTabbedSiteA_InListTabbedSiteA_InstPlcyWinNoShctSiteA_InListTabbedSiteA_LaunchFromListSiteA_TabCreated) {
  // Test contents are generated by script. Please do not modify!
  // See `chrome/test/webapps/README.md` for more info.
  // Sheriffs: Disabling this test is supported.
  helper_.InstallCreateShortcutTabbed("SiteA");
  helper_.CheckAppInListTabbed("SiteA");
  helper_.InstallPolicyAppWindowedNoShortcut("SiteA");
  helper_.CheckAppInListTabbed("SiteA");
  helper_.LaunchFromChromeApps("SiteA");
  helper_.CheckTabCreated();
}

IN_PROC_BROWSER_TEST_F(
    WebAppIntegrationBrowserTest,
    WebAppIntegration_InstCrtShctTabbedSiteA_InListTabbedSiteA_InstPlcyWinNoShctSiteA_InListTabbedSiteA_UninstallPlcySiteA_InListTabbedSiteA) {
  // Test contents are generated by script. Please do not modify!
  // See `chrome/test/webapps/README.md` for more info.
  // Sheriffs: Disabling this test is supported.
  helper_.InstallCreateShortcutTabbed("SiteA");
  helper_.CheckAppInListTabbed("SiteA");
  helper_.InstallPolicyAppWindowedNoShortcut("SiteA");
  helper_.CheckAppInListTabbed("SiteA");
  helper_.UninstallPolicyApp("SiteA");
  helper_.CheckAppInListTabbed("SiteA");
}

IN_PROC_BROWSER_TEST_F(
    WebAppIntegrationBrowserTest,
    WebAppIntegration_InstCrtShctTabbedSiteA_InListTabbedSiteA_InstPlcyWinShctSiteA_InListTabbedSiteA_NavSiteA_InstIconShown) {
  // Test contents are generated by script. Please do not modify!
  // See `chrome/test/webapps/README.md` for more info.
  // Sheriffs: Disabling this test is supported.
  helper_.InstallCreateShortcutTabbed("SiteA");
  helper_.CheckAppInListTabbed("SiteA");
  helper_.InstallPolicyAppWindowedShortcut("SiteA");
  helper_.CheckAppInListTabbed("SiteA");
  helper_.NavigateBrowser("SiteA");
  helper_.CheckInstallIconShown();
}

IN_PROC_BROWSER_TEST_F(
    WebAppIntegrationBrowserTest,
    WebAppIntegration_InstCrtShctTabbedSiteA_InListTabbedSiteA_InstPlcyWinShctSiteA_InListTabbedSiteA_LaunchFromListSiteA_TabCreated) {
  // Test contents are generated by script. Please do not modify!
  // See `chrome/test/webapps/README.md` for more info.
  // Sheriffs: Disabling this test is supported.
  helper_.InstallCreateShortcutTabbed("SiteA");
  helper_.CheckAppInListTabbed("SiteA");
  helper_.InstallPolicyAppWindowedShortcut("SiteA");
  helper_.CheckAppInListTabbed("SiteA");
  helper_.LaunchFromChromeApps("SiteA");
  helper_.CheckTabCreated();
}

IN_PROC_BROWSER_TEST_F(
    WebAppIntegrationBrowserTest,
    WebAppIntegration_InstCrtShctTabbedSiteA_InListTabbedSiteA_InstPlcyWinShctSiteA_InListTabbedSiteA_UninstallPlcySiteA_InListTabbedSiteA) {
  // Test contents are generated by script. Please do not modify!
  // See `chrome/test/webapps/README.md` for more info.
  // Sheriffs: Disabling this test is supported.
  helper_.InstallCreateShortcutTabbed("SiteA");
  helper_.CheckAppInListTabbed("SiteA");
  helper_.InstallPolicyAppWindowedShortcut("SiteA");
  helper_.CheckAppInListTabbed("SiteA");
  helper_.UninstallPolicyApp("SiteA");
  helper_.CheckAppInListTabbed("SiteA");
}

IN_PROC_BROWSER_TEST_F(
    WebAppIntegrationBrowserTest,
    WebAppIntegration_InstCrtShctTabbedSiteA_InListTabbedSiteA_NavSiteA_InstIconShown_LaunchIconNotShown) {
  // Test contents are generated by script. Please do not modify!
  // See `chrome/test/webapps/README.md` for more info.
  // Sheriffs: Disabling this test is supported.
  helper_.InstallCreateShortcutTabbed("SiteA");
  helper_.CheckAppInListTabbed("SiteA");
  helper_.NavigateBrowser("SiteA");
  helper_.CheckInstallIconShown();
  helper_.CheckLaunchIconNotShown();
}

IN_PROC_BROWSER_TEST_F(
    WebAppIntegrationBrowserTest,
    WebAppIntegration_InstCrtShctTabbedSiteA_InListTabbedSiteA_SetOpenWindowSiteA_InListWinSiteA_LaunchFromListSiteA_WindowCreated) {
  // Test contents are generated by script. Please do not modify!
  // See `chrome/test/webapps/README.md` for more info.
  // Sheriffs: Disabling this test is supported.
  helper_.InstallCreateShortcutTabbed("SiteA");
  helper_.CheckAppInListTabbed("SiteA");
  helper_.SetOpenInWindow("SiteA");
  helper_.CheckAppInListWindowed("SiteA");
  helper_.LaunchFromChromeApps("SiteA");
  helper_.CheckWindowCreated();
}

IN_PROC_BROWSER_TEST_F(
    WebAppIntegrationBrowserTest,
    WebAppIntegration_InstCrtShctTabbedSiteA_InListTabbedSiteA_SetOpenWindowSiteA_InListWinSiteA_NavSiteA_InstIconNotShown_LaunchIconShown) {
  // Test contents are generated by script. Please do not modify!
  // See `chrome/test/webapps/README.md` for more info.
  // Sheriffs: Disabling this test is supported.
  helper_.InstallCreateShortcutTabbed("SiteA");
  helper_.CheckAppInListTabbed("SiteA");
  helper_.SetOpenInWindow("SiteA");
  helper_.CheckAppInListWindowed("SiteA");
  helper_.NavigateBrowser("SiteA");
  helper_.CheckInstallIconNotShown();
  helper_.CheckLaunchIconShown();
}

IN_PROC_BROWSER_TEST_F(
    WebAppIntegrationBrowserTest,
    WebAppIntegration_InstCrtShctTabbedSiteA_InListTabbedSiteA_InstPlcyTabNoShctSiteA_UninstallPlcySiteA_InListTabbedSiteA) {
  // Test contents are generated by script. Please do not modify!
  // See `chrome/test/webapps/README.md` for more info.
  // Sheriffs: Disabling this test is supported.
  helper_.InstallCreateShortcutTabbed("SiteA");
  helper_.CheckAppInListTabbed("SiteA");
  helper_.InstallPolicyAppTabbedNoShortcut("SiteA");
  helper_.UninstallPolicyApp("SiteA");
  helper_.CheckAppInListTabbed("SiteA");
}

IN_PROC_BROWSER_TEST_F(
    WebAppIntegrationBrowserTest,
    WebAppIntegration_InstCrtShctTabbedSiteA_InListTabbedSiteA_InstPlcyTabShctSiteA_UninstallPlcySiteA_InListTabbedSiteA) {
  // Test contents are generated by script. Please do not modify!
  // See `chrome/test/webapps/README.md` for more info.
  // Sheriffs: Disabling this test is supported.
  helper_.InstallCreateShortcutTabbed("SiteA");
  helper_.CheckAppInListTabbed("SiteA");
  helper_.InstallPolicyAppTabbedShortcut("SiteA");
  helper_.UninstallPolicyApp("SiteA");
  helper_.CheckAppInListTabbed("SiteA");
}

IN_PROC_BROWSER_TEST_F(
    WebAppIntegrationBrowserTest,
    WebAppIntegration_InstPlcyTabShctSiteA_InListTabbedSiteA_InstCrtShctWindowedSiteA_InListWinSiteA_WindowCreated_UninstallPlcySiteA_InListWinSiteA) {
  // Test contents are generated by script. Please do not modify!
  // See `chrome/test/webapps/README.md` for more info.
  // Sheriffs: Disabling this test is supported.
  helper_.InstallPolicyAppTabbedShortcut("SiteA");
  helper_.CheckAppInListTabbed("SiteA");
  helper_.InstallCreateShortcutWindowed("SiteA");
  helper_.CheckAppInListWindowed("SiteA");
  helper_.CheckWindowCreated();
  helper_.UninstallPolicyApp("SiteA");
  helper_.CheckAppInListWindowed("SiteA");
}

// TODO(crbug.com/1279704): Test is consistently failing on Mac and Win7.
IN_PROC_BROWSER_TEST_F(
    WebAppIntegrationBrowserTest,
    DISABLED_WebAppIntegration_InstPlcyTabShctSiteA_InListTabbedSiteA_InstOmniboxSiteA_InListWinSiteA_WindowCreated_UninstallPlcySiteA_InListWinSiteA) {
  // Test contents are generated by script. Please do not modify!
  // See `chrome/test/webapps/README.md` for more info.
  // Sheriffs: Disabling this test is supported.
  helper_.InstallPolicyAppTabbedShortcut("SiteA");
  helper_.CheckAppInListTabbed("SiteA");
  helper_.InstallOmniboxIcon("SiteA");
  helper_.CheckAppInListWindowed("SiteA");
  helper_.CheckWindowCreated();
  helper_.UninstallPolicyApp("SiteA");
  helper_.CheckAppInListWindowed("SiteA");
}

IN_PROC_BROWSER_TEST_F(
    WebAppIntegrationBrowserTest,
    WebAppIntegration_InstPlcyTabShctSiteA_InListTabbedSiteA_InstMenuOptionSiteA_InListWinSiteA_WindowCreated_UninstallPlcySiteA_InListWinSiteA) {
  // Test contents are generated by script. Please do not modify!
  // See `chrome/test/webapps/README.md` for more info.
  // Sheriffs: Disabling this test is supported.
  helper_.InstallPolicyAppTabbedShortcut("SiteA");
  helper_.CheckAppInListTabbed("SiteA");
  helper_.InstallMenuOption("SiteA");
  helper_.CheckAppInListWindowed("SiteA");
  helper_.CheckWindowCreated();
  helper_.UninstallPolicyApp("SiteA");
  helper_.CheckAppInListWindowed("SiteA");
}

IN_PROC_BROWSER_TEST_F(
    WebAppIntegrationBrowserTest,
    WebAppIntegration_InstPlcyTabShctSiteA_InListTabbedSiteA_NavSiteA_InstIconShown_LaunchIconNotShown) {
  // Test contents are generated by script. Please do not modify!
  // See `chrome/test/webapps/README.md` for more info.
  // Sheriffs: Disabling this test is supported.
  helper_.InstallPolicyAppTabbedShortcut("SiteA");
  helper_.CheckAppInListTabbed("SiteA");
  helper_.NavigateBrowser("SiteA");
  helper_.CheckInstallIconShown();
  helper_.CheckLaunchIconNotShown();
}

// TODO(crbug.com/1279704): Test is consistently failing on Mac and Win7.
IN_PROC_BROWSER_TEST_F(
    WebAppIntegrationBrowserTest,
    DISABLED_WebAppIntegration_InstPlcyTabShctSiteA_InListTabbedSiteA_SetOpenWindowSiteA_LaunchFromListSiteA_WindowCreated) {
  // Test contents are generated by script. Please do not modify!
  // See `chrome/test/webapps/README.md` for more info.
  // Sheriffs: Disabling this test is supported.
  helper_.InstallPolicyAppTabbedShortcut("SiteA");
  helper_.CheckAppInListTabbed("SiteA");
  helper_.SetOpenInWindow("SiteA");
  helper_.LaunchFromChromeApps("SiteA");
  helper_.CheckWindowCreated();
}

IN_PROC_BROWSER_TEST_F(
    WebAppIntegrationBrowserTest,
    WebAppIntegration_InstPlcyTabShctSiteA_InListTabbedSiteA_UninstallPlcySiteA_NotInListSiteA_NavSiteA_InstIconShown_LaunchIconNotShown) {
  // Test contents are generated by script. Please do not modify!
  // See `chrome/test/webapps/README.md` for more info.
  // Sheriffs: Disabling this test is supported.
  helper_.InstallPolicyAppTabbedShortcut("SiteA");
  helper_.CheckAppInListTabbed("SiteA");
  helper_.UninstallPolicyApp("SiteA");
  helper_.CheckAppNotInList("SiteA");
  helper_.NavigateBrowser("SiteA");
  helper_.CheckInstallIconShown();
  helper_.CheckLaunchIconNotShown();
}

// TODO(crbug.com/1286616): Flaky on macOS.
#if BUILDFLAG(IS_MAC)
#define MAYBE_WebAppIntegration_InstCrtShctWindowedSiteC_InListWinSiteC_NavSiteC_InstIconNotShown_LaunchIconShown \
  DISABLED_WebAppIntegration_InstCrtShctWindowedSiteC_InListWinSiteC_NavSiteC_InstIconNotShown_LaunchIconShown
#else
#define MAYBE_WebAppIntegration_InstCrtShctWindowedSiteC_InListWinSiteC_NavSiteC_InstIconNotShown_LaunchIconShown \
  WebAppIntegration_InstCrtShctWindowedSiteC_InListWinSiteC_NavSiteC_InstIconNotShown_LaunchIconShown
#endif
IN_PROC_BROWSER_TEST_F(
    WebAppIntegrationBrowserTest,
    MAYBE_WebAppIntegration_InstCrtShctWindowedSiteC_InListWinSiteC_NavSiteC_InstIconNotShown_LaunchIconShown) {
  // Test contents are generated by script. Please do not modify!
  // See `chrome/test/webapps/README.md` for more info.
  // Sheriffs: Disabling this test is supported.
  helper_.InstallCreateShortcutWindowed("SiteC");
  helper_.CheckAppInListWindowed("SiteC");
  helper_.NavigateBrowser("SiteC");
  helper_.CheckInstallIconNotShown();
  helper_.CheckLaunchIconShown();
}

IN_PROC_BROWSER_TEST_F(
    WebAppIntegrationBrowserTest,
    WebAppIntegration_InstCrtShctWindowedSiteC_InListWinSiteC_LaunchFromListSiteC_WindowCreated) {
  // Test contents are generated by script. Please do not modify!
  // See `chrome/test/webapps/README.md` for more info.
  // Sheriffs: Disabling this test is supported.
  helper_.InstallCreateShortcutWindowed("SiteC");
  helper_.CheckAppInListWindowed("SiteC");
  helper_.LaunchFromChromeApps("SiteC");
  helper_.CheckWindowCreated();
}

IN_PROC_BROWSER_TEST_F(
    WebAppIntegrationBrowserTest,
    WebAppIntegration_InstCrtShctTabbedSiteC_InListTabbedSiteC_NavSiteC_InstIconNotShown_LaunchIconNotShown) {
  // Test contents are generated by script. Please do not modify!
  // See `chrome/test/webapps/README.md` for more info.
  // Sheriffs: Disabling this test is supported.
  helper_.InstallCreateShortcutTabbed("SiteC");
  helper_.CheckAppInListTabbed("SiteC");
  helper_.NavigateBrowser("SiteC");
  helper_.CheckInstallIconNotShown();
  helper_.CheckLaunchIconNotShown();
}

IN_PROC_BROWSER_TEST_F(
    WebAppIntegrationBrowserTest,
    WebAppIntegration_InstCrtShctTabbedSiteC_InListTabbedSiteC_LaunchFromListSiteC_TabCreated) {
  // Test contents are generated by script. Please do not modify!
  // See `chrome/test/webapps/README.md` for more info.
  // Sheriffs: Disabling this test is supported.
  helper_.InstallCreateShortcutTabbed("SiteC");
  helper_.CheckAppInListTabbed("SiteC");
  helper_.LaunchFromChromeApps("SiteC");
  helper_.CheckTabCreated();
}

IN_PROC_BROWSER_TEST_F(
    WebAppIntegrationBrowserTest,
    WebAppIntegration_InstPlcyWinNoShctSiteC_InListWinSiteC_NavSiteC_InstIconNotShown_LaunchIconShown) {
  // Test contents are generated by script. Please do not modify!
  // See `chrome/test/webapps/README.md` for more info.
  // Sheriffs: Disabling this test is supported.
  helper_.InstallPolicyAppWindowedNoShortcut("SiteC");
  helper_.CheckAppInListWindowed("SiteC");
  helper_.NavigateBrowser("SiteC");
  helper_.CheckInstallIconNotShown();
  helper_.CheckLaunchIconShown();
}

// TODO(crbug.com/1279704): Flaky on macOS.
#if BUILDFLAG(IS_MAC)
#define MAYBE_WebAppIntegration_InstPlcyWinNoShctSiteC_InListWinSiteC_LaunchFromListSiteC_WindowCreated \
  DISABLED_WebAppIntegration_InstPlcyWinNoShctSiteC_InListWinSiteC_LaunchFromListSiteC_WindowCreated
#else
#define MAYBE_WebAppIntegration_InstPlcyWinNoShctSiteC_InListWinSiteC_LaunchFromListSiteC_WindowCreated \
  WebAppIntegration_InstPlcyWinNoShctSiteC_InListWinSiteC_LaunchFromListSiteC_WindowCreated
#endif
IN_PROC_BROWSER_TEST_F(
    WebAppIntegrationBrowserTest,
    MAYBE_WebAppIntegration_InstPlcyWinNoShctSiteC_InListWinSiteC_LaunchFromListSiteC_WindowCreated) {
  // Test contents are generated by script. Please do not modify!
  // See `chrome/test/webapps/README.md` for more info.
  // Sheriffs: Disabling this test is supported.
  helper_.InstallPolicyAppWindowedNoShortcut("SiteC");
  helper_.CheckAppInListWindowed("SiteC");
  helper_.LaunchFromChromeApps("SiteC");
  helper_.CheckWindowCreated();
}

IN_PROC_BROWSER_TEST_F(
    WebAppIntegrationBrowserTest,
    WebAppIntegration_InstPlcyTabNoShctSiteC_InListTabbedSiteC_NavSiteC_InstIconNotShown_LaunchIconNotShown) {
  // Test contents are generated by script. Please do not modify!
  // See `chrome/test/webapps/README.md` for more info.
  // Sheriffs: Disabling this test is supported.
  helper_.InstallPolicyAppTabbedNoShortcut("SiteC");
  helper_.CheckAppInListTabbed("SiteC");
  helper_.NavigateBrowser("SiteC");
  helper_.CheckInstallIconNotShown();
  helper_.CheckLaunchIconNotShown();
}

IN_PROC_BROWSER_TEST_F(
    WebAppIntegrationBrowserTest,
    WebAppIntegration_InstPlcyTabNoShctSiteC_InListTabbedSiteC_LaunchFromListSiteC_TabCreated) {
  // Test contents are generated by script. Please do not modify!
  // See `chrome/test/webapps/README.md` for more info.
  // Sheriffs: Disabling this test is supported.
  helper_.InstallPolicyAppTabbedNoShortcut("SiteC");
  helper_.CheckAppInListTabbed("SiteC");
  helper_.LaunchFromChromeApps("SiteC");
  helper_.CheckTabCreated();
}

IN_PROC_BROWSER_TEST_F(
    WebAppIntegrationBrowserTest,
    WebAppIntegration_InstPlcyTabShctSiteC_InListTabbedSiteC_NavSiteC_InstIconNotShown_LaunchIconNotShown) {
  // Test contents are generated by script. Please do not modify!
  // See `chrome/test/webapps/README.md` for more info.
  // Sheriffs: Disabling this test is supported.
  helper_.InstallPolicyAppTabbedShortcut("SiteC");
  helper_.CheckAppInListTabbed("SiteC");
  helper_.NavigateBrowser("SiteC");
  helper_.CheckInstallIconNotShown();
  helper_.CheckLaunchIconNotShown();
}

IN_PROC_BROWSER_TEST_F(
    WebAppIntegrationBrowserTest,
    WebAppIntegration_InstPlcyTabShctSiteC_InListTabbedSiteC_LaunchFromListSiteC_TabCreated) {
  // Test contents are generated by script. Please do not modify!
  // See `chrome/test/webapps/README.md` for more info.
  // Sheriffs: Disabling this test is supported.
  helper_.InstallPolicyAppTabbedShortcut("SiteC");
  helper_.CheckAppInListTabbed("SiteC");
  helper_.LaunchFromChromeApps("SiteC");
  helper_.CheckTabCreated();
}

IN_PROC_BROWSER_TEST_F(
    WebAppIntegrationBrowserTest,
    WebAppIntegration_InstCrtShctWindowedSiteB_NavSiteB_LaunchIconShown) {
  // Test contents are generated by script. Please do not modify!
  // See `chrome/test/webapps/README.md` for more info.
  // Sheriffs: Disabling this test is supported.
  helper_.InstallCreateShortcutWindowed("SiteB");
  helper_.NavigateBrowser("SiteB");
  helper_.CheckLaunchIconShown();
}

IN_PROC_BROWSER_TEST_F(
    WebAppIntegrationBrowserTest,
    WebAppIntegration_InstCrtShctWindowedSiteB_LaunchFromListSiteB_Minimal) {
  // Test contents are generated by script. Please do not modify!
  // See `chrome/test/webapps/README.md` for more info.
  // Sheriffs: Disabling this test is supported.
  helper_.InstallCreateShortcutWindowed("SiteB");
  helper_.LaunchFromChromeApps("SiteB");
  helper_.CheckWindowDisplayMinimal();
}

// TODO(crbug.com/1286616): Flaky on macOS.
#if BUILDFLAG(IS_MAC)
#define MAYBE_WebAppIntegration_InstOmniboxSiteB_NavSiteB_LaunchIconShown \
  DISABLED_WebAppIntegration_InstOmniboxSiteB_NavSiteB_LaunchIconShown
#else
#define MAYBE_WebAppIntegration_InstOmniboxSiteB_NavSiteB_LaunchIconShown \
  WebAppIntegration_InstOmniboxSiteB_NavSiteB_LaunchIconShown
#endif
IN_PROC_BROWSER_TEST_F(
    WebAppIntegrationBrowserTest,
    MAYBE_WebAppIntegration_InstOmniboxSiteB_NavSiteB_LaunchIconShown) {
  // Test contents are generated by script. Please do not modify!
  // See `chrome/test/webapps/README.md` for more info.
  // Sheriffs: Disabling this test is supported.
  helper_.InstallOmniboxIcon("SiteB");
  helper_.NavigateBrowser("SiteB");
  helper_.CheckLaunchIconShown();
}

// TODO(crbug.com/1279704): Flaky on macOS.
#if BUILDFLAG(IS_MAC)
#define MAYBE_WebAppIntegration_InstOmniboxSiteB_LaunchFromListSiteB_Minimal \
  DISABLED_WebAppIntegration_InstOmniboxSiteB_LaunchFromListSiteB_Minimal
#else
#define MAYBE_WebAppIntegration_InstOmniboxSiteB_LaunchFromListSiteB_Minimal \
  WebAppIntegration_InstOmniboxSiteB_LaunchFromListSiteB_Minimal
#endif
IN_PROC_BROWSER_TEST_F(
    WebAppIntegrationBrowserTest,
    MAYBE_WebAppIntegration_InstOmniboxSiteB_LaunchFromListSiteB_Minimal) {
  // Test contents are generated by script. Please do not modify!
  // See `chrome/test/webapps/README.md` for more info.
  // Sheriffs: Disabling this test is supported.
  helper_.InstallOmniboxIcon("SiteB");
  helper_.LaunchFromChromeApps("SiteB");
  helper_.CheckWindowDisplayMinimal();
}

IN_PROC_BROWSER_TEST_F(
    WebAppIntegrationBrowserTest,
    WebAppIntegration_InstPlcyWinNoShctSiteB_NavSiteB_LaunchIconShown) {
  // Test contents are generated by script. Please do not modify!
  // See `chrome/test/webapps/README.md` for more info.
  // Sheriffs: Disabling this test is supported.
  helper_.InstallPolicyAppWindowedNoShortcut("SiteB");
  helper_.NavigateBrowser("SiteB");
  helper_.CheckLaunchIconShown();
}

IN_PROC_BROWSER_TEST_F(
    WebAppIntegrationBrowserTest,
    WebAppIntegration_InstPlcyWinNoShctSiteB_LaunchFromListSiteB_Minimal) {
  // Test contents are generated by script. Please do not modify!
  // See `chrome/test/webapps/README.md` for more info.
  // Sheriffs: Disabling this test is supported.
  helper_.InstallPolicyAppWindowedNoShortcut("SiteB");
  helper_.LaunchFromChromeApps("SiteB");
  helper_.CheckWindowDisplayMinimal();
}

IN_PROC_BROWSER_TEST_F(
    WebAppIntegrationBrowserTest,
    WebAppIntegration_InstPlcyWinShctSiteB_NavSiteB_LaunchIconShown) {
  // Test contents are generated by script. Please do not modify!
  // See `chrome/test/webapps/README.md` for more info.
  // Sheriffs: Disabling this test is supported.
  helper_.InstallPolicyAppWindowedShortcut("SiteB");
  helper_.NavigateBrowser("SiteB");
  helper_.CheckLaunchIconShown();
}

IN_PROC_BROWSER_TEST_F(
    WebAppIntegrationBrowserTest,
    WebAppIntegration_InstPlcyWinShctSiteB_LaunchFromListSiteB_Minimal) {
  // Test contents are generated by script. Please do not modify!
  // See `chrome/test/webapps/README.md` for more info.
  // Sheriffs: Disabling this test is supported.
  helper_.InstallPolicyAppWindowedShortcut("SiteB");
  helper_.LaunchFromChromeApps("SiteB");
  helper_.CheckWindowDisplayMinimal();
}

// TODO(crbug.com/1286616): Flaky on macOS.
#if BUILDFLAG(IS_MAC)
#define MAYBE_WebAppIntegration_InstMenuOptionSiteB_NavSiteB_LaunchIconShown \
  DISABLED_WebAppIntegration_InstMenuOptionSiteB_NavSiteB_LaunchIconShown
#else
#define MAYBE_WebAppIntegration_InstMenuOptionSiteB_NavSiteB_LaunchIconShown \
  WebAppIntegration_InstMenuOptionSiteB_NavSiteB_LaunchIconShown
#endif
IN_PROC_BROWSER_TEST_F(
    WebAppIntegrationBrowserTest,
    MAYBE_WebAppIntegration_InstMenuOptionSiteB_NavSiteB_LaunchIconShown) {
  // Test contents are generated by script. Please do not modify!
  // See `chrome/test/webapps/README.md` for more info.
  // Sheriffs: Disabling this test is supported.
  helper_.InstallMenuOption("SiteB");
  helper_.NavigateBrowser("SiteB");
  helper_.CheckLaunchIconShown();
}

IN_PROC_BROWSER_TEST_F(
    WebAppIntegrationBrowserTest,
    WebAppIntegration_InstMenuOptionSiteB_LaunchFromListSiteB_Minimal) {
  // Test contents are generated by script. Please do not modify!
  // See `chrome/test/webapps/README.md` for more info.
  // Sheriffs: Disabling this test is supported.
  helper_.InstallMenuOption("SiteB");
  helper_.LaunchFromChromeApps("SiteB");
  helper_.CheckWindowDisplayMinimal();
}

IN_PROC_BROWSER_TEST_F(
    WebAppIntegrationBrowserTest,
    WebAppIntegration_InstPlcyWinShctSiteC_InListWinSiteC_NavSiteC_InstIconNotShown_LaunchIconShown) {
  // Test contents are generated by script. Please do not modify!
  // See `chrome/test/webapps/README.md` for more info.
  // Sheriffs: Disabling this test is supported.
  helper_.InstallPolicyAppWindowedShortcut("SiteC");
  helper_.CheckAppInListWindowed("SiteC");
  helper_.NavigateBrowser("SiteC");
  helper_.CheckInstallIconNotShown();
  helper_.CheckLaunchIconShown();
}

// TODO(crbug.com/1279704): Test is consistently failing on Mac and Win7.
IN_PROC_BROWSER_TEST_F(
    WebAppIntegrationBrowserTest,
    DISABLED_WebAppIntegration_InstPlcyWinShctSiteC_InListWinSiteC_LaunchFromListSiteC_WindowCreated) {
  // Test contents are generated by script. Please do not modify!
  // See `chrome/test/webapps/README.md` for more info.
  // Sheriffs: Disabling this test is supported.
  helper_.InstallPolicyAppWindowedShortcut("SiteC");
  helper_.CheckAppInListWindowed("SiteC");
  helper_.LaunchFromChromeApps("SiteC");
  helper_.CheckWindowCreated();
}

IN_PROC_BROWSER_TEST_F(WebAppIntegrationBrowserTest,
                       WebAppIntegration_InstCrtShctWindowedSiteAFoo_ClosePWA) {
  // Test contents are generated by script. Please do not modify!
  // See `chrome/test/webapps/README.md` for more info.
  // Sheriffs: Disabling this test is supported.
  helper_.InstallCreateShortcutWindowed("SiteAFoo");
  helper_.ClosePwa();
}

IN_PROC_BROWSER_TEST_F(
    WebAppIntegrationBrowserTest,
    WebAppIntegration_InstCrtShctWindowedSiteAFoo_NavSiteABar_InstIconShown_LaunchIconNotShown) {
  // Test contents are generated by script. Please do not modify!
  // See `chrome/test/webapps/README.md` for more info.
  // Sheriffs: Disabling this test is supported.
  helper_.InstallCreateShortcutWindowed("SiteAFoo");
  helper_.NavigateBrowser("SiteABar");
  helper_.CheckInstallIconShown();
  helper_.CheckLaunchIconNotShown();
}

IN_PROC_BROWSER_TEST_F(WebAppIntegrationBrowserTest,
                       WebAppIntegration_InstOmniboxSiteAFoo_ClosePWA) {
  // Test contents are generated by script. Please do not modify!
  // See `chrome/test/webapps/README.md` for more info.
  // Sheriffs: Disabling this test is supported.
  helper_.InstallOmniboxIcon("SiteAFoo");
  helper_.ClosePwa();
}

IN_PROC_BROWSER_TEST_F(
    WebAppIntegrationBrowserTest,
    WebAppIntegration_InstOmniboxSiteAFoo_NavSiteABar_InstIconShown_LaunchIconNotShown) {
  // Test contents are generated by script. Please do not modify!
  // See `chrome/test/webapps/README.md` for more info.
  // Sheriffs: Disabling this test is supported.
  helper_.InstallOmniboxIcon("SiteAFoo");
  helper_.NavigateBrowser("SiteABar");
  helper_.CheckInstallIconShown();
  helper_.CheckLaunchIconNotShown();
}

IN_PROC_BROWSER_TEST_F(WebAppIntegrationBrowserTest,
                       WebAppIntegration_InstMenuOptionSiteAFoo_ClosePWA) {
  // Test contents are generated by script. Please do not modify!
  // See `chrome/test/webapps/README.md` for more info.
  // Sheriffs: Disabling this test is supported.
  helper_.InstallMenuOption("SiteAFoo");
  helper_.ClosePwa();
}

IN_PROC_BROWSER_TEST_F(
    WebAppIntegrationBrowserTest,
    WebAppIntegration_InstMenuOptionSiteAFoo_NavSiteABar_InstIconShown_LaunchIconNotShown) {
  // Test contents are generated by script. Please do not modify!
  // See `chrome/test/webapps/README.md` for more info.
  // Sheriffs: Disabling this test is supported.
  helper_.InstallMenuOption("SiteAFoo");
  helper_.NavigateBrowser("SiteABar");
  helper_.CheckInstallIconShown();
  helper_.CheckLaunchIconNotShown();
}

IN_PROC_BROWSER_TEST_F(
    WebAppIntegrationBrowserTest,
    WebAppIntegration_InstPlcyWinNoShctSiteAFoo_NavSiteABar_InstIconShown_LaunchIconNotShown) {
  // Test contents are generated by script. Please do not modify!
  // See `chrome/test/webapps/README.md` for more info.
  // Sheriffs: Disabling this test is supported.
  helper_.InstallPolicyAppWindowedNoShortcut("SiteAFoo");
  helper_.NavigateBrowser("SiteABar");
  helper_.CheckInstallIconShown();
  helper_.CheckLaunchIconNotShown();
}

IN_PROC_BROWSER_TEST_F(
    WebAppIntegrationBrowserTest,
    WebAppIntegration_InstPlcyWinShctSiteAFoo_NavSiteABar_InstIconShown_LaunchIconNotShown) {
  // Test contents are generated by script. Please do not modify!
  // See `chrome/test/webapps/README.md` for more info.
  // Sheriffs: Disabling this test is supported.
  helper_.InstallPolicyAppWindowedShortcut("SiteAFoo");
  helper_.NavigateBrowser("SiteABar");
  helper_.CheckInstallIconShown();
  helper_.CheckLaunchIconNotShown();
}

IN_PROC_BROWSER_TEST_F(WebAppIntegrationBrowserTest,
                       WebAppIntegration_NavSiteAFoo_InstIconShown) {
  // Test contents are generated by script. Please do not modify!
  // See `chrome/test/webapps/README.md` for more info.
  // Sheriffs: Disabling this test is supported.
  helper_.NavigateBrowser("SiteAFoo");
  helper_.CheckInstallIconShown();
}

IN_PROC_BROWSER_TEST_F(WebAppIntegrationBrowserTest,
                       WebAppIntegration_NavSiteA_NotInListSiteA) {
  // Test contents are generated by script. Please do not modify!
  // See `chrome/test/webapps/README.md` for more info.
  // Sheriffs: Disabling this test is supported.
  helper_.NavigateBrowser("SiteA");
  helper_.CheckAppNotInList("SiteA");
}

IN_PROC_BROWSER_TEST_F(
    WebAppIntegrationBrowserTest,
    WebAppIntegration_NavSiteC_NotInListSiteA_InstIconNotShown) {
  // Test contents are generated by script. Please do not modify!
  // See `chrome/test/webapps/README.md` for more info.
  // Sheriffs: Disabling this test is supported.
  helper_.NavigateBrowser("SiteC");
  helper_.CheckAppNotInList("SiteA");
  helper_.CheckInstallIconNotShown();
}

// TODO(crbug.com/1279704): Flaky on macOS.
#if BUILDFLAG(IS_MAC)
#define MAYBE_WebAppIntegration_InstCrtShctWindowedSiteA_WindowCreated_InListWinSiteA_InstPlcyTabNoShctSiteA_InListWinSiteA_LaunchFromIconSiteA_WindowCreated \
  DISABLED_WebAppIntegration_InstCrtShctWindowedSiteA_WindowCreated_InListWinSiteA_InstPlcyTabNoShctSiteA_InListWinSiteA_LaunchFromIconSiteA_WindowCreated
#else
#define MAYBE_WebAppIntegration_InstCrtShctWindowedSiteA_WindowCreated_InListWinSiteA_InstPlcyTabNoShctSiteA_InListWinSiteA_LaunchFromIconSiteA_WindowCreated \
  WebAppIntegration_InstCrtShctWindowedSiteA_WindowCreated_InListWinSiteA_InstPlcyTabNoShctSiteA_InListWinSiteA_LaunchFromIconSiteA_WindowCreated
#endif
IN_PROC_BROWSER_TEST_F(
    WebAppIntegrationBrowserTest,
    MAYBE_WebAppIntegration_InstCrtShctWindowedSiteA_WindowCreated_InListWinSiteA_InstPlcyTabNoShctSiteA_InListWinSiteA_LaunchFromIconSiteA_WindowCreated) {
  // Test contents are generated by script. Please do not modify!
  // See `chrome/test/webapps/README.md` for more info.
  // Sheriffs: Disabling this test is supported.
  helper_.InstallCreateShortcutWindowed("SiteA");
  helper_.CheckWindowCreated();
  helper_.CheckAppInListWindowed("SiteA");
  helper_.InstallPolicyAppTabbedNoShortcut("SiteA");
  helper_.CheckAppInListWindowed("SiteA");
  helper_.LaunchFromLaunchIcon("SiteA");
  helper_.CheckWindowCreated();
}

IN_PROC_BROWSER_TEST_F(
    WebAppIntegrationBrowserTest,
    DISABLED_WebAppIntegration_InstCrtShctWindowedSiteA_WindowCreated_InListWinSiteA_InstPlcyTabShctSiteA_InListWinSiteA_LaunchFromIconSiteA_WindowCreated) {
  // Test contents are generated by script. Please do not modify!
  // See `chrome/test/webapps/README.md` for more info.
  // Sheriffs: Disabling this test is supported.
  helper_.InstallCreateShortcutWindowed("SiteA");
  helper_.CheckWindowCreated();
  helper_.CheckAppInListWindowed("SiteA");
  helper_.InstallPolicyAppTabbedShortcut("SiteA");
  helper_.CheckAppInListWindowed("SiteA");
  helper_.LaunchFromLaunchIcon("SiteA");
  helper_.CheckWindowCreated();
}

IN_PROC_BROWSER_TEST_F(
    WebAppIntegrationBrowserTest,
    DISABLED_WebAppIntegration_InstCrtShctWindowedSiteA_WindowCreated_InListWinSiteA_ClosePWA_MnfstUpdateDsplMinimalSiteA_LaunchFromIconSiteA_Minimal) {
  // Test contents are generated by script. Please do not modify!
  // See `chrome/test/webapps/README.md` for more info.
  // Sheriffs: Disabling this test is supported.
  helper_.InstallCreateShortcutWindowed("SiteA");
  helper_.CheckWindowCreated();
  helper_.CheckAppInListWindowed("SiteA");
  helper_.ClosePwa();
  helper_.ManifestUpdateDisplayMinimal("SiteA");
  helper_.LaunchFromLaunchIcon("SiteA");
  helper_.CheckWindowDisplayMinimal();
}

// TODO(crbug.com/1279704): Test is consistently failing on Mac and Win7.
IN_PROC_BROWSER_TEST_F(
    WebAppIntegrationBrowserTest,
    DISABLED_WebAppIntegration_InstCrtShctWindowedSiteA_WindowCreated_InListWinSiteA_LaunchFromIconSiteA_WindowCreated_Standalone) {
  // Test contents are generated by script. Please do not modify!
  // See `chrome/test/webapps/README.md` for more info.
  // Sheriffs: Disabling this test is supported.
  helper_.InstallCreateShortcutWindowed("SiteA");
  helper_.CheckWindowCreated();
  helper_.CheckAppInListWindowed("SiteA");
  helper_.LaunchFromLaunchIcon("SiteA");
  helper_.CheckWindowCreated();
  helper_.CheckWindowDisplayStandalone();
}

IN_PROC_BROWSER_TEST_F(
    WebAppIntegrationBrowserTest,
    WebAppIntegration_InstOmniboxSiteA_WindowCreated_InListWinSiteA_InstPlcyTabNoShctSiteA_InListWinSiteA_LaunchFromIconSiteA_WindowCreated) {
  // Test contents are generated by script. Please do not modify!
  // See `chrome/test/webapps/README.md` for more info.
  // Sheriffs: Disabling this test is supported.
  helper_.InstallOmniboxIcon("SiteA");
  helper_.CheckWindowCreated();
  helper_.CheckAppInListWindowed("SiteA");
  helper_.InstallPolicyAppTabbedNoShortcut("SiteA");
  helper_.CheckAppInListWindowed("SiteA");
  helper_.LaunchFromLaunchIcon("SiteA");
  helper_.CheckWindowCreated();
}

// Test is flaky. See https://crbug.com/1280125
IN_PROC_BROWSER_TEST_F(
    WebAppIntegrationBrowserTest,
    DISABLED_WebAppIntegration_InstOmniboxSiteA_WindowCreated_InListWinSiteA_InstPlcyTabShctSiteA_InListWinSiteA_LaunchFromIconSiteA_WindowCreated) {
  // Test contents are generated by script. Please do not modify!
  // See `chrome/test/webapps/README.md` for more info.
  // Sheriffs: Disabling this test is supported.
  helper_.InstallOmniboxIcon("SiteA");
  helper_.CheckWindowCreated();
  helper_.CheckAppInListWindowed("SiteA");
  helper_.InstallPolicyAppTabbedShortcut("SiteA");
  helper_.CheckAppInListWindowed("SiteA");
  helper_.LaunchFromLaunchIcon("SiteA");
  helper_.CheckWindowCreated();
}

IN_PROC_BROWSER_TEST_F(
    WebAppIntegrationBrowserTest,
    DISABLED_WebAppIntegration_InstOmniboxSiteA_WindowCreated_InListWinSiteA_ClosePWA_MnfstUpdateDsplMinimalSiteA_LaunchFromIconSiteA_Minimal) {
  // Test contents are generated by script. Please do not modify!
  // See `chrome/test/webapps/README.md` for more info.
  // Sheriffs: Disabling this test is supported.
  helper_.InstallOmniboxIcon("SiteA");
  helper_.CheckWindowCreated();
  helper_.CheckAppInListWindowed("SiteA");
  helper_.ClosePwa();
  helper_.ManifestUpdateDisplayMinimal("SiteA");
  helper_.LaunchFromLaunchIcon("SiteA");
  helper_.CheckWindowDisplayMinimal();
}

IN_PROC_BROWSER_TEST_F(
    WebAppIntegrationBrowserTest,
    WebAppIntegration_InstOmniboxSiteA_WindowCreated_InListWinSiteA_LaunchFromIconSiteA_WindowCreated_Standalone) {
  // Test contents are generated by script. Please do not modify!
  // See `chrome/test/webapps/README.md` for more info.
  // Sheriffs: Disabling this test is supported.
  helper_.InstallOmniboxIcon("SiteA");
  helper_.CheckWindowCreated();
  helper_.CheckAppInListWindowed("SiteA");
  helper_.LaunchFromLaunchIcon("SiteA");
  helper_.CheckWindowCreated();
  helper_.CheckWindowDisplayStandalone();
}

// TODO(crbug.com/1279704): Test is consistently failing on Mac and Win7.
IN_PROC_BROWSER_TEST_F(
    WebAppIntegrationBrowserTest,
    DISABLED_WebAppIntegration_InstMenuOptionSiteA_WindowCreated_InListWinSiteA_InstPlcyTabNoShctSiteA_InListWinSiteA_LaunchFromIconSiteA_WindowCreated) {
  // Test contents are generated by script. Please do not modify!
  // See `chrome/test/webapps/README.md` for more info.
  // Sheriffs: Disabling this test is supported.
  helper_.InstallMenuOption("SiteA");
  helper_.CheckWindowCreated();
  helper_.CheckAppInListWindowed("SiteA");
  helper_.InstallPolicyAppTabbedNoShortcut("SiteA");
  helper_.CheckAppInListWindowed("SiteA");
  helper_.LaunchFromLaunchIcon("SiteA");
  helper_.CheckWindowCreated();
}

// Test is flaky. See https://crbug.com/1280125
IN_PROC_BROWSER_TEST_F(
    WebAppIntegrationBrowserTest,
    DISABLED_WebAppIntegration_InstMenuOptionSiteA_WindowCreated_InListWinSiteA_InstPlcyTabShctSiteA_InListWinSiteA_LaunchFromIconSiteA_WindowCreated) {
  // Test contents are generated by script. Please do not modify!
  // See `chrome/test/webapps/README.md` for more info.
  // Sheriffs: Disabling this test is supported.
  helper_.InstallMenuOption("SiteA");
  helper_.CheckWindowCreated();
  helper_.CheckAppInListWindowed("SiteA");
  helper_.InstallPolicyAppTabbedShortcut("SiteA");
  helper_.CheckAppInListWindowed("SiteA");
  helper_.LaunchFromLaunchIcon("SiteA");
  helper_.CheckWindowCreated();
}

IN_PROC_BROWSER_TEST_F(
    WebAppIntegrationBrowserTest,
    DISABLED_WebAppIntegration_InstMenuOptionSiteA_WindowCreated_InListWinSiteA_ClosePWA_MnfstUpdateDsplMinimalSiteA_LaunchFromIconSiteA_Minimal) {
  // Test contents are generated by script. Please do not modify!
  // See `chrome/test/webapps/README.md` for more info.
  // Sheriffs: Disabling this test is supported.
  helper_.InstallMenuOption("SiteA");
  helper_.CheckWindowCreated();
  helper_.CheckAppInListWindowed("SiteA");
  helper_.ClosePwa();
  helper_.ManifestUpdateDisplayMinimal("SiteA");
  helper_.LaunchFromLaunchIcon("SiteA");
  helper_.CheckWindowDisplayMinimal();
}

IN_PROC_BROWSER_TEST_F(
    WebAppIntegrationBrowserTest,
    WebAppIntegration_InstMenuOptionSiteA_WindowCreated_InListWinSiteA_LaunchFromIconSiteA_WindowCreated_Standalone) {
  // Test contents are generated by script. Please do not modify!
  // See `chrome/test/webapps/README.md` for more info.
  // Sheriffs: Disabling this test is supported.
  helper_.InstallMenuOption("SiteA");
  helper_.CheckWindowCreated();
  helper_.CheckAppInListWindowed("SiteA");
  helper_.LaunchFromLaunchIcon("SiteA");
  helper_.CheckWindowCreated();
  helper_.CheckWindowDisplayStandalone();
}

IN_PROC_BROWSER_TEST_F(
    WebAppIntegrationBrowserTest,
    WebAppIntegration_InstPlcyWinNoShctSiteA_InListWinSiteA_LaunchFromIconSiteA_WindowCreated_Standalone) {
  // Test contents are generated by script. Please do not modify!
  // See `chrome/test/webapps/README.md` for more info.
  // Sheriffs: Disabling this test is supported.
  helper_.InstallPolicyAppWindowedNoShortcut("SiteA");
  helper_.CheckAppInListWindowed("SiteA");
  helper_.LaunchFromLaunchIcon("SiteA");
  helper_.CheckWindowCreated();
  helper_.CheckWindowDisplayStandalone();
}

IN_PROC_BROWSER_TEST_F(
    WebAppIntegrationBrowserTest,
    WebAppIntegration_InstPlcyWinShctSiteA_InListWinSiteA_LaunchFromIconSiteA_WindowCreated_Standalone) {
  // Test contents are generated by script. Please do not modify!
  // See `chrome/test/webapps/README.md` for more info.
  // Sheriffs: Disabling this test is supported.
  helper_.InstallPolicyAppWindowedShortcut("SiteA");
  helper_.CheckAppInListWindowed("SiteA");
  helper_.LaunchFromLaunchIcon("SiteA");
  helper_.CheckWindowCreated();
  helper_.CheckWindowDisplayStandalone();
}

IN_PROC_BROWSER_TEST_F(
    WebAppIntegrationBrowserTest,
    WebAppIntegration_InstPlcyTabNoShctSiteA_InListTabbedSiteA_SetOpenWindowSiteA_LaunchFromIconSiteA_WindowCreated) {
  // Test contents are generated by script. Please do not modify!
  // See `chrome/test/webapps/README.md` for more info.
  // Sheriffs: Disabling this test is supported.
  helper_.InstallPolicyAppTabbedNoShortcut("SiteA");
  helper_.CheckAppInListTabbed("SiteA");
  helper_.SetOpenInWindow("SiteA");
  helper_.LaunchFromLaunchIcon("SiteA");
  helper_.CheckWindowCreated();
}

// TODO(crbug.com/1279704): Test is consistently failing on Mac and Win7.
IN_PROC_BROWSER_TEST_F(
    WebAppIntegrationBrowserTest,
    DISABLED_WebAppIntegration_InstCrtShctTabbedSiteA_InListTabbedSiteA_SetOpenWindowSiteA_InListWinSiteA_LaunchFromIconSiteA_WindowCreated) {
  // Test contents are generated by script. Please do not modify!
  // See `chrome/test/webapps/README.md` for more info.
  // Sheriffs: Disabling this test is supported.
  helper_.InstallCreateShortcutTabbed("SiteA");
  helper_.CheckAppInListTabbed("SiteA");
  helper_.SetOpenInWindow("SiteA");
  helper_.CheckAppInListWindowed("SiteA");
  helper_.LaunchFromLaunchIcon("SiteA");
  helper_.CheckWindowCreated();
}

IN_PROC_BROWSER_TEST_F(
    WebAppIntegrationBrowserTest,
    WebAppIntegration_InstPlcyTabShctSiteA_InListTabbedSiteA_SetOpenWindowSiteA_LaunchFromIconSiteA_WindowCreated) {
  // Test contents are generated by script. Please do not modify!
  // See `chrome/test/webapps/README.md` for more info.
  // Sheriffs: Disabling this test is supported.
  helper_.InstallPolicyAppTabbedShortcut("SiteA");
  helper_.CheckAppInListTabbed("SiteA");
  helper_.SetOpenInWindow("SiteA");
  helper_.LaunchFromLaunchIcon("SiteA");
  helper_.CheckWindowCreated();
}

IN_PROC_BROWSER_TEST_F(
    WebAppIntegrationBrowserTest,
    WebAppIntegration_InstCrtShctWindowedSiteC_InListWinSiteC_LaunchFromIconSiteC_WindowCreated) {
  // Test contents are generated by script. Please do not modify!
  // See `chrome/test/webapps/README.md` for more info.
  // Sheriffs: Disabling this test is supported.
  helper_.InstallCreateShortcutWindowed("SiteC");
  helper_.CheckAppInListWindowed("SiteC");
  helper_.LaunchFromLaunchIcon("SiteC");
  helper_.CheckWindowCreated();
}

IN_PROC_BROWSER_TEST_F(
    WebAppIntegrationBrowserTest,
    WebAppIntegration_InstPlcyWinNoShctSiteC_InListWinSiteC_LaunchFromIconSiteC_WindowCreated) {
  // Test contents are generated by script. Please do not modify!
  // See `chrome/test/webapps/README.md` for more info.
  // Sheriffs: Disabling this test is supported.
  helper_.InstallPolicyAppWindowedNoShortcut("SiteC");
  helper_.CheckAppInListWindowed("SiteC");
  helper_.LaunchFromLaunchIcon("SiteC");
  helper_.CheckWindowCreated();
}

IN_PROC_BROWSER_TEST_F(
    WebAppIntegrationBrowserTest,
    WebAppIntegration_InstCrtShctWindowedSiteB_LaunchFromIconSiteB_Minimal) {
  // Test contents are generated by script. Please do not modify!
  // See `chrome/test/webapps/README.md` for more info.
  // Sheriffs: Disabling this test is supported.
  helper_.InstallCreateShortcutWindowed("SiteB");
  helper_.LaunchFromLaunchIcon("SiteB");
  helper_.CheckWindowDisplayMinimal();
}

IN_PROC_BROWSER_TEST_F(
    WebAppIntegrationBrowserTest,
    WebAppIntegration_InstOmniboxSiteB_LaunchFromIconSiteB_Minimal) {
  // Test contents are generated by script. Please do not modify!
  // See `chrome/test/webapps/README.md` for more info.
  // Sheriffs: Disabling this test is supported.
  helper_.InstallOmniboxIcon("SiteB");
  helper_.LaunchFromLaunchIcon("SiteB");
  helper_.CheckWindowDisplayMinimal();
}

IN_PROC_BROWSER_TEST_F(
    WebAppIntegrationBrowserTest,
    WebAppIntegration_InstPlcyWinNoShctSiteB_LaunchFromIconSiteB_Minimal) {
  // Test contents are generated by script. Please do not modify!
  // See `chrome/test/webapps/README.md` for more info.
  // Sheriffs: Disabling this test is supported.
  helper_.InstallPolicyAppWindowedNoShortcut("SiteB");
  helper_.LaunchFromLaunchIcon("SiteB");
  helper_.CheckWindowDisplayMinimal();
}

IN_PROC_BROWSER_TEST_F(
    WebAppIntegrationBrowserTest,
    WebAppIntegration_InstPlcyWinShctSiteB_LaunchFromIconSiteB_Minimal) {
  // Test contents are generated by script. Please do not modify!
  // See `chrome/test/webapps/README.md` for more info.
  // Sheriffs: Disabling this test is supported.
  helper_.InstallPolicyAppWindowedShortcut("SiteB");
  helper_.LaunchFromLaunchIcon("SiteB");
  helper_.CheckWindowDisplayMinimal();
}

IN_PROC_BROWSER_TEST_F(
    WebAppIntegrationBrowserTest,
    WebAppIntegration_InstMenuOptionSiteB_LaunchFromIconSiteB_Minimal) {
  // Test contents are generated by script. Please do not modify!
  // See `chrome/test/webapps/README.md` for more info.
  // Sheriffs: Disabling this test is supported.
  helper_.InstallMenuOption("SiteB");
  helper_.LaunchFromLaunchIcon("SiteB");
  helper_.CheckWindowDisplayMinimal();
}

IN_PROC_BROWSER_TEST_F(
    WebAppIntegrationBrowserTest,
    WebAppIntegration_InstPlcyWinShctSiteC_InListWinSiteC_LaunchFromIconSiteC_WindowCreated) {
  // Test contents are generated by script. Please do not modify!
  // See `chrome/test/webapps/README.md` for more info.
  // Sheriffs: Disabling this test is supported.
  helper_.InstallPolicyAppWindowedShortcut("SiteC");
  helper_.CheckAppInListWindowed("SiteC");
  helper_.LaunchFromLaunchIcon("SiteC");
  helper_.CheckWindowCreated();
}

IN_PROC_BROWSER_TEST_F(WebAppIntegrationBrowserTest,
                       WebAppIntegration_NavNotfound_InstIconNotShown) {
  // Test contents are generated by script. Please do not modify!
  // See `chrome/test/webapps/README.md` for more info.
  // Sheriffs: Disabling this test is supported.
  helper_.NavigateNotfoundUrl();
  helper_.CheckInstallIconNotShown();
}

IN_PROC_BROWSER_TEST_F(
    WebAppIntegrationBrowserTest,
    WebAppIntegration_InstCrtShctWindowedSiteA_WindowCreated_InListWinSiteA_NavPWASiteAToSiteB_Toolbar_CloseToolbar_IsAtStartUrl) {
  // Test contents are generated by script. Please do not modify!
  // See `chrome/test/webapps/README.md` for more info.
  // Sheriffs: Disabling this test is supported.
  helper_.InstallCreateShortcutWindowed("SiteA");
  helper_.CheckWindowCreated();
  helper_.CheckAppInListWindowed("SiteA");
  helper_.NavigatePwaSiteATo("SiteB");
  helper_.CheckCustomToolbar();
  helper_.CloseCustomToolbar();
  helper_.CheckAppNavigationIsStartUrl();
}

IN_PROC_BROWSER_TEST_F(
    WebAppIntegrationBrowserTest,
    WebAppIntegration_InstOmniboxSiteA_WindowCreated_InListWinSiteA_NavPWASiteAToSiteB_Toolbar_CloseToolbar_IsAtStartUrl) {
  // Test contents are generated by script. Please do not modify!
  // See `chrome/test/webapps/README.md` for more info.
  // Sheriffs: Disabling this test is supported.
  helper_.InstallOmniboxIcon("SiteA");
  helper_.CheckWindowCreated();
  helper_.CheckAppInListWindowed("SiteA");
  helper_.NavigatePwaSiteATo("SiteB");
  helper_.CheckCustomToolbar();
  helper_.CloseCustomToolbar();
  helper_.CheckAppNavigationIsStartUrl();
}

IN_PROC_BROWSER_TEST_F(
    WebAppIntegrationBrowserTest,
    WebAppIntegration_InstMenuOptionSiteA_WindowCreated_InListWinSiteA_NavPWASiteAToSiteB_Toolbar_CloseToolbar_IsAtStartUrl) {
  // Test contents are generated by script. Please do not modify!
  // See `chrome/test/webapps/README.md` for more info.
  // Sheriffs: Disabling this test is supported.
  helper_.InstallMenuOption("SiteA");
  helper_.CheckWindowCreated();
  helper_.CheckAppInListWindowed("SiteA");
  helper_.NavigatePwaSiteATo("SiteB");
  helper_.CheckCustomToolbar();
  helper_.CloseCustomToolbar();
  helper_.CheckAppNavigationIsStartUrl();
}

// crbug.com/1264574 - Disabled due to flakiness.
IN_PROC_BROWSER_TEST_F(
    WebAppIntegrationBrowserTest,
    DISABLED_WebAppIntegration_InstPlcyWinNoShctSiteA_InListWinSiteA_NavPWASiteAToSiteB_CloseToolbar_IsAtStartUrl) {
  // Test contents are generated by script. Please do not modify!
  // See `chrome/test/webapps/README.md` for more info.
  // Sheriffs: Disabling this test is supported.
  helper_.InstallPolicyAppWindowedNoShortcut("SiteA");
  helper_.CheckAppInListWindowed("SiteA");
  helper_.NavigatePwaSiteATo("SiteB");
  helper_.CloseCustomToolbar();
  helper_.CheckAppNavigationIsStartUrl();
}

// crbug.com/1264681 - disabled due to flakiness.
IN_PROC_BROWSER_TEST_F(
    WebAppIntegrationBrowserTest,
    DISABLED_WebAppIntegration_InstPlcyWinShctSiteA_InListWinSiteA_NavPWASiteAToSiteB_CloseToolbar_IsAtStartUrl) {
  // Test contents are generated by script. Please do not modify!
  // See `chrome/test/webapps/README.md` for more info.
  // Sheriffs: Disabling this test is supported.
  helper_.InstallPolicyAppWindowedShortcut("SiteA");
  helper_.CheckAppInListWindowed("SiteA");
  helper_.NavigatePwaSiteATo("SiteB");
  helper_.CloseCustomToolbar();
  helper_.CheckAppNavigationIsStartUrl();
}

IN_PROC_BROWSER_TEST_F(
    WebAppIntegrationBrowserTest,
    WebAppIntegration_InstCrtShctWindowedSiteA_WindowCreated_InListWinSiteA_UninstallFromListSiteA_NotInListSiteA_NavSiteA_InstIconShown_LaunchIconNotShown) {
  // Test contents are generated by script. Please do not modify!
  // See `chrome/test/webapps/README.md` for more info.
  // Sheriffs: Disabling this test is supported.
  helper_.InstallCreateShortcutWindowed("SiteA");
  helper_.CheckWindowCreated();
  helper_.CheckAppInListWindowed("SiteA");
  helper_.UninstallFromList("SiteA");
  helper_.CheckAppNotInList("SiteA");
  helper_.NavigateBrowser("SiteA");
  helper_.CheckInstallIconShown();
  helper_.CheckLaunchIconNotShown();
}

// TODO(crbug.com/1279704): Test is consistently failing on Mac and Win7.
IN_PROC_BROWSER_TEST_F(
    WebAppIntegrationBrowserTest,
    DISABLED_WebAppIntegration_InstOmniboxSiteA_WindowCreated_InListWinSiteA_UninstallFromListSiteA_NotInListSiteA_NavSiteA_InstIconShown_LaunchIconNotShown) {
  // Test contents are generated by script. Please do not modify!
  // See `chrome/test/webapps/README.md` for more info.
  // Sheriffs: Disabling this test is supported.
  helper_.InstallOmniboxIcon("SiteA");
  helper_.CheckWindowCreated();
  helper_.CheckAppInListWindowed("SiteA");
  helper_.UninstallFromList("SiteA");
  helper_.CheckAppNotInList("SiteA");
  helper_.NavigateBrowser("SiteA");
  helper_.CheckInstallIconShown();
  helper_.CheckLaunchIconNotShown();
}

IN_PROC_BROWSER_TEST_F(
    WebAppIntegrationBrowserTest,
    WebAppIntegration_InstMenuOptionSiteA_WindowCreated_InListWinSiteA_UninstallFromListSiteA_NotInListSiteA_NavSiteA_InstIconShown_LaunchIconNotShown) {
  // Test contents are generated by script. Please do not modify!
  // See `chrome/test/webapps/README.md` for more info.
  // Sheriffs: Disabling this test is supported.
  helper_.InstallMenuOption("SiteA");
  helper_.CheckWindowCreated();
  helper_.CheckAppInListWindowed("SiteA");
  helper_.UninstallFromList("SiteA");
  helper_.CheckAppNotInList("SiteA");
  helper_.NavigateBrowser("SiteA");
  helper_.CheckInstallIconShown();
  helper_.CheckLaunchIconNotShown();
}

IN_PROC_BROWSER_TEST_F(
    WebAppIntegrationBrowserTest,
    WebAppIntegration_InstCrtShctTabbedSiteA_InListTabbedSiteA_UninstallFromListSiteA_NotInListSiteA_NavSiteA_InstIconShown_LaunchIconNotShown) {
  // Test contents are generated by script. Please do not modify!
  // See `chrome/test/webapps/README.md` for more info.
  // Sheriffs: Disabling this test is supported.
  helper_.InstallCreateShortcutTabbed("SiteA");
  helper_.CheckAppInListTabbed("SiteA");
  helper_.UninstallFromList("SiteA");
  helper_.CheckAppNotInList("SiteA");
  helper_.NavigateBrowser("SiteA");
  helper_.CheckInstallIconShown();
  helper_.CheckLaunchIconNotShown();
}

IN_PROC_BROWSER_TEST_F(
    WebAppIntegrationBrowserTest,
    WebAppIntegration_InstCrtShctWindowedSiteC_InListWinSiteC_UninstallFromListSiteC_NotInListSiteA) {
  // Test contents are generated by script. Please do not modify!
  // See `chrome/test/webapps/README.md` for more info.
  // Sheriffs: Disabling this test is supported.
  helper_.InstallCreateShortcutWindowed("SiteC");
  helper_.CheckAppInListWindowed("SiteC");
  helper_.UninstallFromList("SiteC");
  helper_.CheckAppNotInList("SiteA");
}

IN_PROC_BROWSER_TEST_F(
    WebAppIntegrationBrowserTest,
    WebAppIntegration_InstCrtShctTabbedSiteC_InListTabbedSiteC_UninstallFromListSiteC_NotInListSiteA) {
  // Test contents are generated by script. Please do not modify!
  // See `chrome/test/webapps/README.md` for more info.
  // Sheriffs: Disabling this test is supported.
  helper_.InstallCreateShortcutTabbed("SiteC");
  helper_.CheckAppInListTabbed("SiteC");
  helper_.UninstallFromList("SiteC");
  helper_.CheckAppNotInList("SiteA");
}

}  // namespace web_app
